<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="http://www.r-bloggers.com/introducing-xda-r-package-for-exploratory-data-analysis/"></div></div><div><a data-url="http://www.r-bloggers.com/introducing-xda-r-package-for-exploratory-data-analysis/" data-counturl="http://www.r-bloggers.com/introducing-xda-r-package-for-exploratory-data-analysis/" data-count="horizontal" data-text="Introducing xda: R package for exploratory data analysis" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://ujjwalkarn.me/2016/06/17/introducing-xda-r-package-for-exploratory-data-analysis/"> R Language – the data science blog</a></strong>, and kindly contributed to <a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>This R package contains several tools to perform initial exploratory analysis on any input dataset. It includes custom functions for plotting the data as well as performing different kinds of analyses such as univariate, bivariate and multivariate investigation which is the first step of any predictive modeling pipeline. This package can be used to get a good sense of any dataset before jumping on to building predictive models. <a target="_blank" href="https://github.com/ujjwalkarn/xda/blob/master/README.md">You can install the package from GitHub</a>.</p>
<p>The functions currently included in the package are mentioned below:</p>
<ul>
<li><strong>numSummary(mydata) </strong>function automatically detects all numeric columns in the dataframe mydata and provides their summary statistics</li>
<li><strong>charSummary(mydata)</strong> function automatically detects all character columns in the dataframe mydata and provides their summary statistics</li>
<li><strong>Plot(mydata, dep.var) </strong>plots all independent variables in the dataframe mydata against the dependant variable specified by the dep.var parameter</li>
<li><strong>removeSpecial(mydata, vec)</strong> replaces all special characters (specified by vector vec) in the dataframe mydata with NA</li>
<li><strong>bivariate(mydata, dep.var, indep.var)</strong> performs bivariate analysis between dependent variable dep.var and independent variable indep.var in the dataframe mydata</li>
</ul>
<h2>Installation</h2>
<p>To install the <strong>xda</strong> package, <strong>devtools</strong> package needs to be installed first. To install devtools, please follow instructions <a target="_blank" href="https://github.com/hadley/devtools">here</a>.</p>
<p>Then, use the following commands to install <strong>xda</strong>:</p>
<pre>
library(devtools)
install_github(&quot;ujjwalkarn/xda&quot;)
</pre>
<h2>Usage</h2>
<p>For all examples below, the <a target="_blank" href="https://en.wikipedia.org/wiki/Iris_flower_data_set">popular iris dataset </a>has been used. The data set consists of 50 samples from each of three species of Iris (Iris setosa, Iris virginica and Iris versicolor).</p>
<pre>
library(xda)

## to view a comprehensive summary for all numeric columns in the iris dataset

numSummary(iris)

## n = total number of rows for that variable
## miss = number of rows with missing value
## miss% = percentage of total rows with missing values ((miss/n)*100)
## 5% = 5th percentile value of that variable (value below which 5 percent of the observations may be found)
## the percentile values are helpful in detecting outliers
</pre>
<p><img alt="numSummary" class="wp-image-34" src="https://ujwlkarn.files.wordpress.com/2016/05/numsummary.png?w=723"></p>
<pre>
## to view a comprehensive summary for all character columns in the iris dataset

charSummary(iris)

## n = total number of rows for that variable
## miss = number of rows with missing value
## miss% = percentage of total rows with missing values ((n/miss)*100)
## unique = number of unique levels of that variable
## note that there is only one character column (Species) in the iris dataset

</pre>
<p><img alt="charSummary" class="wp-image-36" src="https://ujwlkarn.files.wordpress.com/2016/05/charsummary.png?w=723"></p>
<pre>
## to perform bivariate analysis between 'Species' and 'Sepal.Length' in the iris dataset

bivariate(iris,'Species','Sepal.Length')

## bin_Sepal.Length = 'Sepal.Length' variable has been binned into 4 equal intervals (original range is [4.3,7.9])
## for each interval of 'Sepal.Length', the number of samples from each category of 'Species' is shown
## i.e. 39 of the 50 samples of Setosa have Sepal.Length is in the range (4.3,5.2], and so on. ## the number of intervals (4 in this case) can be customized (see documentation)

</pre>
<p><img alt="bivariate" class="wp-image-35" src="https://ujwlkarn.files.wordpress.com/2016/05/bivariate.png?w=723"></p>
<pre>
## to plot all other variables against the 'Petal.Length' variable in the iris dataset

Plot(iris,'Petal.Length')

</pre>
<p><img alt="Plot1" class="wp-image-44" src="https://ujwlkarn.files.wordpress.com/2016/05/plot1.png?w=723"> <img alt="Plot2" class="wp-image-37" src="https://ujwlkarn.files.wordpress.com/2016/05/plot2.png?w=723"></p>
<p>The package is constantly under development and more functionalities will be added soon. Will also add this to CRAN in the coming days. Pull requests to add more functions are welcome!</p>
<p> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ujwlkarn.wordpress.com/20/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/ujwlkarn.wordpress.com/20/" border="0"></a> <img height="1" alt="" width="1" src="https://pixel.wp.com/b.gif?host=ujjwalkarn.me&blog=71076491&%23038;post=20&%23038;subd=ujwlkarn&%23038;ref=&%23038;feed=1" border="0"></p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="http://www.r-bloggers.com/introducing-xda-r-package-for-exploratory-data-analysis/"></div></div><div><a data-url="http://www.r-bloggers.com/introducing-xda-r-package-for-exploratory-data-analysis/" data-counturl="http://www.r-bloggers.com/introducing-xda-r-package-for-exploratory-data-analysis/" data-count="vertical" data-text="Introducing xda: R package for exploratory data analysis" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://ujjwalkarn.me/2016/06/17/introducing-xda-r-package-for-exploratory-data-analysis/"> R Language – the data science blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="http://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="http://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="http://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="http://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/Twpwo7HSWXM"></a></div>