knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
EDA is critical to every Data Analytics engagement. The intent is to:
install.packages("devtools") devtools::install_github("gramener/eda")
library(eda)
help(package = eda)
help(metadata) help(univariate) help(bivariate)
meta <- metadata$new(path = "Specify path to the file you want to conduct EDA on")
meta$output()
meta$columns$age$type <- "discrete"
meta$save(savepath = "path to the existing excel file or a new excel file to be created",sheet = "Metadata Analysis")
Binning: https://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule
uni <- univariate$new(metadata = meta,k = 3)
uni$output()
uni$save(path = "path to the existing excel file or a new excel file to be created",sheet = "Univariate Analysis") uni$saveplot(path = "path to the existing excel file or a new excel file to be created")
uni$saveplot(path = "path to the existing excel file or a new excel file to be created")
- Categorical - Categorical Variable : Cross Tab of Count and Proportion of Records - Numeric - Categorical Variable : Sum, Average, Min, Max of Records
- Numeric - Categorical Variable : Bar Plot for Sum, Average, Min, Max Records - Numeric - Numeric : Scatter Plot and Correlation Plot
bi <- bivariate$new(metadata = meta)
bi$output()
bi$save(path = "path to the existing excel file or a new excel file to be created")
bi$saveplot(path = "path to the existing excel file or a new excel file to be created",method = "pearson")
This is a basic example which shows you how to solve a common problem:
##Install the eda package install_github("gramener/eda") ##Load the eda package library(eda) ##To compute the metadata for the iris dataset do: meta <- metadata$new(data = iris) ##To view the metadata output onto the console: meta$output() ##To save the metadata output into a xlsx file: meta$save(savepath = "C:/Users/Admin/Desktop/Output.xlsx") ##To compute the univariate analysis do: uni <- univariate$new(metadata = meta) ##To view the univariate analysis onto the console: uni$output() ##To save the univariate analysis into a xlsx file do: uni$save(savepath = "C:/Users/Admin/Desktop/Output.xlsx") ##To save the univariate plots into a xlsx file do: uni$saveplot(savepath = "C:/Users/Admin/Desktop/Output.xlsx") ##To compute the bivariate analysis do: bi <- bivariate$new(metadata = meta) ##To view the bivariate analysis onto the console: bi$output() ##To save the bivariate analysis into a xlsx file do: bi$save(savepath = "C:/Users/Admin/Desktop/Output.xlsx") ##To save the bivariate plots into a xlsx file do: bi$saveplot(savepath = "C:/Users/Admin/Desktop/Output.xlsx",method = "pearson")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.