Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.99 KB

README.org

File metadata and controls

59 lines (39 loc) · 1.99 KB

edar

Exploratory Data Analysis in R (edar) is a R package designed to reduce the amount of code needed to do EDA in R. It provides a set of wrap functions that incapsulate some tidyverse functionalities.

Instalation

devtools::install_github("DiogoFerrari/edar")
# If you don't want to update the dependencies, use: (you may need to install some dependencies manually)
devtools::install_github("DiogoFerrari/edar", dependencies=F)

Usage

library(edar)
library(magrittr)

data(edar_survey)
data = edar_survey
# help(data)

## summarise all numerical variables
data %>% summarise_alln(., group=NULL, weight=NULL, spread=F)
data %>% summarise_alln(., group="gender", weight=NULL, spread=F)

## summarise all categorical variables
data %>% summarise_allc(., group=NULL)
data %>% summarise_allc(., group="gender")

## bundle all cateorical variables based on their categories and summarise them
tab = data %>% summarise_allcbundle(., group=NULL)
tab
tab$Table[[1]]  ## Table with counts
tab$Tablep[[1]] ## Table with percentages
tab$Tablel[[1]] ## Table with counts and percentages

## check balance of covariates between two groups (ex: treatment vs control, see Imbens, G. W., & Rubin, D. B., Causal inference in statistics, social, and biomedical sciences: an introduction (2015), : Cambridge University Press.) 
data %>% ebalance(., treatmentVar='treat')

See other functions in the package vignette.

vignette(edar)

More information

See this webpage and pdf with examples.