<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/using-r-to-drive-ms-excel-3-27-2018/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://ibecav.github.io/RtoExcel/"> Chuck Powell</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>I have until recently made it a habit to draw a clear distinction about<br>
using R for data analysis and Microsoft Excel for other office<br>
productivity tasks. I know there are people who use Excel to process<br>
data and even <strong>(gasp)</strong> to teach statistics with it. But I’m a bit<br>
snobbish that way and to date all my efforts have been in getting data<br>
out of Excel and into R, either by simple methods like <code>read.csv</code> or if<br>
the task was more meaty by using Hadley Wickham’s marvelous <code>readxl</code><br>
package.</p>
<p>But this week I got a request that may sound familiar to some of you who<br>
work in an environment where the MS Office products are ubiquitous. My<br>
colleague wanted to be able to do a little analysis and graphing of a<br>
modest sized dataset and they only really had MS Excel experience. To be<br>
honest I could have just done the work in <code>R</code> and provided the results<br>
but that’s not what they asked for and would have meant I was<br>
responsible for future updates and questions. So I decided to just<br>
provide the data in the most useful way I could and that led to this<br>
post. To both document the process and also to potentially help others<br>
who have this need in the future.</p>
<p>Along the way I also had some nice learning experiences around functions<br>
and both standard and non standard evaluation <code>NSE</code> that I’ll document<br>
in some future posts.</p>
<h2>Background</h2>
<p>My colleague wanted to be able to do some simple analysis around health<br>
care using the Centers for Disease Control and Prevention<br>
(<a rel="nofollow" href="https://www.cdc.gov/" target="_blank">https://www.cdc.gov</a>), National Center for Health Statistics<br>
(<a rel="nofollow" href="https://www.cdc.gov/nchs/index.htm" target="_blank">https://www.cdc.gov/nchs/index.htm</a>), National Health Interview Survey<br>
(<a rel="nofollow" href="https://www.cdc.gov/nchs/nhis/nhis_2016_data_release.htm" target="_blank">https://www.cdc.gov/nchs/nhis/nhis_2016_data_release.htm</a>). They<br>
wanted a series of cross tabulated sets of summary data for variable<br>
pairings (for example whether or not the respondent had a formal health<br>
care provider by region of the country). They wanted one Excel<br>
“workbook” with 12 worksheets each one of which was the summary of<br>
counts for a pair of variables. From there they could use Excel’s native<br>
plotting tools to make the graphs they needed.</p>
<p>A little sleuthing around CRAN helped me discover <code>openxlsx</code> which seems<br>
to be quite active, well maintained, and have a variety of features I<br>
would need. In my case that involved a download and install first (but<br>
I’ll comment it out in this version for you). As long as I’m at it<br>
I’ll load <code>dplyr</code> and <code>ggplot2</code> (they’ll figure more prominently in my<br>
next post).</p>
<div>
<div>
<pre><code><span>knitr</span><span>::</span><span>opts_chunk</span><span>$</span><span>set</span><span>(</span><span>echo</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>,</span><span> </span><span>warning</span><span> </span><span>=</span><span> </span><span>FALSE</span><span>)</span><span>
</span><span>library</span><span>(</span><span>dplyr</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>## 
## Attaching package: 'dplyr'

## The following objects are masked from 'package:stats':
## 
##     filter, lag

## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
</code></pre>
</div>
</div>
<div>
<div>
<pre><code><span>library</span><span>(</span><span>ggplot2</span><span>)</span><span>
</span><span>theme_set</span><span>(</span><span>theme_bw</span><span>())</span><span> </span><span># set theme to my personal preference</span><span>
</span><span># install.packages(&quot;openxlsx&quot;)</span><span>
</span><span>require</span><span>(</span><span>openxlsx</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>## Loading required package: openxlsx
</code></pre>
</div>
</div>
<h2>Download and structure the data</h2>
<p>The data my colleague wanted was from 2014 and she was kind enough to<br>
provide the URL for a compressed zipfile<br>
<a rel="nofollow" target="_blank">ftp://ftp.cdc.gov/pub/Health_Statistics/NCHS/Datasets/NHIS/2016/personsxcsv.zip</a>.<br>
Full documentation about the file and its contents and the methodology<br>
is here <a rel="nofollow" href="https://www.cdc.gov/nchs/nhis/nhis_2016_data_release.htm" target="_blank">https://www.cdc.gov/nchs/nhis/nhis_2016_data_release.htm</a>.</p>
<p>After downloading and uncompressing it into a local project directory<br>
(it’s about 77Mb of data, with over 100,000 rows and more than 600<br>
columns). I could go to work on processing it to get what was really<br>
needed for my colleague.</p>
<div>
<div>
<pre><code><span>FullFile</span><span> </span><span>&lt;-</span><span> </span><span>read.csv</span><span>(</span><span>file</span><span> </span><span>=</span><span> </span><span>&quot;personsx.csv&quot;</span><span>)</span><span>
</span><span>dim</span><span>(</span><span>FullFile</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>## [1] 103789    606
</code></pre>
</div>
</div>
<div>
<div>
<pre><code><span># 606 variables too many whittle it down with wild cards</span><span>
</span></code></pre>
</div>
</div>
<h2>A little <code>dplyr</code> to make our life easier</h2>
<p>While strictly speaking nothing in the next few steps requires <code>dplyr</code><br>
(they can all be done in base <code>R</code>) I will showcase a couple ways <code>dplyr</code><br>
can make your data analysis faster and easier.</p>
<p>First off, call me old-fashioned but, I abhor having lots of data in<br>
working memory that I know for a fact I’ll never use. While my Mac has<br>
plenty of space let’s showcase <code>dplyr</code>’s ability to help us rapidly<br>
reduce down to a more manageable dataset. A quick look at the data<br>
dictionary provided by the <strong>CDC</strong> shows we’ll never use any of the<br>
variables in the dataset that start with “L” or with “INT” so let’s make<br>
them go away.</p>
<div>
<div>
<pre><code><span>FullFile</span><span> </span><span>&lt;-</span><span> </span><span>select</span><span>(</span><span>FullFile</span><span>,</span><span> </span><span>-</span><span>starts_with</span><span>(</span><span>&quot;L&quot;</span><span>))</span><span>
</span><span>FullFile</span><span> </span><span>&lt;-</span><span> </span><span>select</span><span>(</span><span>FullFile</span><span>,</span><span> </span><span>-</span><span>starts_with</span><span>(</span><span>&quot;INT&quot;</span><span>))</span><span>
</span><span>dim</span><span>(</span><span>FullFile</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>## [1] 103789    289
</code></pre>
</div>
</div>
<div>
<div>
<pre><code><span># 289 is still big but ...</span><span>
</span></code></pre>
</div>
</div>
<p>The other thing we notice is that the variables are all coded as integers when<br>
we know they are truly factors. Since we know we’re going to analyze<br>
them as factors let’s take a moment to recode which will also mean an<br>
opportunity to provide more user friendly labels so we’re not constantly<br>
referring to the code book to see what “1” really represents in the<br>
data.</p>
<p>The function is <code>recode_factor</code> and allows us to map factor labels onto<br>
the integers to provide a more useful dataset.</p>
<div>
<div>
<pre><code><span>FullFile</span><span>$</span><span>REGION</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>REGION</span><span>,</span><span>
</span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Northeast&quot;</span><span>,</span><span>
</span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;Midwest&quot;</span><span>,</span><span>
</span><span>`3`</span><span> </span><span>=</span><span> </span><span>&quot;South&quot;</span><span>,</span><span>
</span><span>`4`</span><span> </span><span>=</span><span> </span><span>&quot;West&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>SEX</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>SEX</span><span>,</span><span> </span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Male&quot;</span><span>,</span><span> </span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;Female&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>RACERPI2</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>RACERPI2</span><span>,</span><span>
</span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;White only&quot;</span><span>,</span><span>
</span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;Black/African American only&quot;</span><span>,</span><span>
</span><span>`3`</span><span> </span><span>=</span><span> </span><span>&quot;AIAN only&quot;</span><span>,</span><span> </span><span>`4`</span><span> </span><span>=</span><span> </span><span>&quot;Asian only&quot;</span><span>,</span><span>
</span><span>`5`</span><span> </span><span>=</span><span> </span><span>&quot;Race group not releasable&quot;</span><span>,</span><span>
</span><span>`6`</span><span> </span><span>=</span><span> </span><span>&quot;Multiple race&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>PDMED12M</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>PDMED12M</span><span>,</span><span> </span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Yes&quot;</span><span>,</span><span> </span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;No&quot;</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>## Warning: Unreplaced values treated as NA as .x is not compatible. Please
## specify replacements exhaustively or supply .default
</code></pre>
</div>
</div>
<div>
<div>
<pre><code><span>summary</span><span>(</span><span>FullFile</span><span>$</span><span>PDMED12M</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>##   Yes    No  NA's 
##  6744 96986    59
</code></pre>
</div>
</div>
<p>Uh oh, what are we being warned about? <code>recode_factor</code> has a nice<br>
rational solution for cases where we don’t specify all the possible<br>
choices for a variable (see <code>?recode_factor</code>) it simply assigns them an<br>
<code>NA</code> value. In our case that’s just what we want.</p>
<p>Finishing the rest (and suppressing the<br>
warnings)…</p>
<div>
<div>
<pre><code><span>FullFile</span><span>$</span><span>PNMED12</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>PNMED12</span><span>,</span><span> </span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Yes&quot;</span><span>,</span><span> </span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;No&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>PNMED12M</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>PNMED12M</span><span>,</span><span> </span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Yes&quot;</span><span>,</span><span> </span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;No&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>NOTCOV</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>NOTCOV</span><span>,</span><span> </span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Not covered&quot;</span><span>,</span><span> </span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;Covered&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>COVER</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>COVER</span><span>,</span><span>
</span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Private&quot;</span><span>,</span><span>
</span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;Medicaid and other public&quot;</span><span>,</span><span>
</span><span>`3`</span><span> </span><span>=</span><span> </span><span>&quot;Other coverage&quot;</span><span>,</span><span>
</span><span>`4`</span><span> </span><span>=</span><span> </span><span>&quot;Uninsured&quot;</span><span>,</span><span>
</span><span>`5`</span><span> </span><span>=</span><span> </span><span>&quot;Do not know&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>PLNWRKS1</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>PLNWRKS1</span><span>,</span><span>
</span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Through employer&quot;</span><span>,</span><span>
</span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;Through union&quot;</span><span>,</span><span>
</span><span>`3`</span><span> </span><span>=</span><span> </span><span>&quot;Through workplace, but don't know if employer or union&quot;</span><span>,</span><span>
</span><span>`4`</span><span> </span><span>=</span><span> </span><span>&quot;Through workplace, self-employed or professional association&quot;</span><span>,</span><span>
</span><span>`5`</span><span> </span><span>=</span><span> </span><span>&quot;Purchased directly&quot;</span><span>,</span><span>
</span><span>`6`</span><span> </span><span>=</span><span> </span><span>&quot;Through Healthcare.gov or the Affordable Care Act&quot;</span><span>,</span><span>
</span><span>`7`</span><span> </span><span>=</span><span> </span><span>&quot;Through a state/local government or community program&quot;</span><span>,</span><span>
</span><span>`8`</span><span> </span><span>=</span><span> </span><span>&quot;Other&quot;</span><span>,</span><span>
</span><span>`9`</span><span> </span><span>=</span><span> </span><span>&quot;Through school&quot;</span><span>,</span><span>
</span><span>`10`</span><span> </span><span>=</span><span> </span><span>&quot;Through parents&quot;</span><span>,</span><span>
</span><span>`11`</span><span> </span><span>=</span><span> </span><span>&quot;Through relative other than parents&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>HCSPFYR</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>HCSPFYR</span><span>,</span><span>
</span><span>`0`</span><span> </span><span>=</span><span> </span><span>&quot;Zero&quot;</span><span>,</span><span>
</span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Less than $500&quot;</span><span>,</span><span>
</span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;$500 - $1,999&quot;</span><span>,</span><span>
</span><span>`3`</span><span> </span><span>=</span><span> </span><span>&quot;$2,000 - $2,999&quot;</span><span>,</span><span>
</span><span>`4`</span><span> </span><span>=</span><span> </span><span>&quot;$3,000 - $4,999&quot;</span><span>,</span><span>
</span><span>`5`</span><span> </span><span>=</span><span> </span><span>&quot;$5,000 or more&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>MEDBILL</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>MEDBILL</span><span>,</span><span> </span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Yes&quot;</span><span>,</span><span> </span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;No&quot;</span><span>)</span><span>
</span><span>FullFile</span><span>$</span><span>MEDBPAY</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>MEDBPAY</span><span>,</span><span> </span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;Yes&quot;</span><span>,</span><span> </span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;No&quot;</span><span>)</span><span>
</span><span># I am thinking that earnings can be collapsed into three attributes: low; medium; high</span><span>
</span><span>FullFile</span><span>$</span><span>EARNINGS</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>ERNYR</span><span>,</span><span>
</span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;$01-$34,999&quot;</span><span>,</span><span>
</span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;$01-$34,999&quot;</span><span>,</span><span>
</span><span>`3`</span><span> </span><span>=</span><span> </span><span>&quot;$01-$34,999&quot;</span><span>,</span><span>
</span><span>`4`</span><span> </span><span>=</span><span> </span><span>&quot;$01-$34,999&quot;</span><span>,</span><span>
</span><span>`5`</span><span> </span><span>=</span><span> </span><span>&quot;$01-$34,999&quot;</span><span>,</span><span>
</span><span>`6`</span><span> </span><span>=</span><span> </span><span>&quot;$01-$34,999&quot;</span><span>,</span><span>
</span><span>`7`</span><span> </span><span>=</span><span> </span><span>&quot;$35,000-$74,999&quot;</span><span>,</span><span>
</span><span>`8`</span><span> </span><span>=</span><span> </span><span>&quot;$35,000-$74,999&quot;</span><span>,</span><span>
</span><span>`9`</span><span> </span><span>=</span><span> </span><span>&quot;$35,000-$74,999&quot;</span><span>,</span><span>
</span><span>`10`</span><span> </span><span>=</span><span> </span><span>&quot;$35,000-$74,999&quot;</span><span>,</span><span>
</span><span>`11`</span><span> </span><span>=</span><span> </span><span>&quot;$75,000 and over&quot;</span><span>)</span><span>
</span><span># Education the same: low; medium; high</span><span>
</span><span>FullFile</span><span>$</span><span>EDUCATION</span><span> </span><span>&lt;-</span><span> </span><span>recode_factor</span><span>(</span><span>FullFile</span><span>$</span><span>EDUC1</span><span>,</span><span>
</span><span>`0`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`1`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`2`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`3`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`4`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`5`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`6`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`7`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`8`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`9`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`10`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`11`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`12`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`13`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`14`</span><span> </span><span>=</span><span> </span><span>&quot;HSchool Grad or less&quot;</span><span>,</span><span>
</span><span>`15`</span><span> </span><span>=</span><span> </span><span>&quot;Some college or AA degree&quot;</span><span>,</span><span>
</span><span>`16`</span><span> </span><span>=</span><span> </span><span>&quot;Some college or AA degree&quot;</span><span>,</span><span>
</span><span>`17`</span><span> </span><span>=</span><span> </span><span>&quot;Some college or AA degree&quot;</span><span>,</span><span>
</span><span>`18`</span><span> </span><span>=</span><span> </span><span>&quot;Bachelor's or higher&quot;</span><span>,</span><span>
</span><span>`19`</span><span> </span><span>=</span><span> </span><span>&quot;Bachelor's or higher&quot;</span><span>,</span><span>
</span><span>`20`</span><span> </span><span>=</span><span> </span><span>&quot;Bachelor's or higher&quot;</span><span>,</span><span>
</span><span>`21`</span><span> </span><span>=</span><span> </span><span>&quot;Bachelor's or higher&quot;</span><span>)</span><span>
</span><span># Age also collapsed: low; medium; high</span><span>
</span><span>FullFile</span><span>$</span><span>AGE</span><span> </span><span>&lt;-</span><span> </span><span>cut</span><span>(</span><span>FullFile</span><span>$</span><span>AGE_P</span><span>,</span><span>
</span><span>breaks</span><span> </span><span>=</span><span> </span><span>c</span><span>(</span><span>-</span><span>Inf</span><span>,</span><span> </span><span>18</span><span>,</span><span> </span><span>61</span><span>,</span><span> </span><span>Inf</span><span>),</span><span>
</span><span>labels</span><span> </span><span>=</span><span> </span><span>c</span><span>(</span><span>&quot;Less than 18&quot;</span><span>,</span><span> </span><span>&quot;18 to 60&quot;</span><span>,</span><span> </span><span>&quot;More than 60&quot;</span><span>),</span><span>
</span><span>right</span><span> </span><span>=</span><span> </span><span>FALSE</span><span>)</span><span>
</span><span>table</span><span>(</span><span>FullFile</span><span>$</span><span>EDUC1</span><span>,</span><span>FullFile</span><span>$</span><span>EDUCATION</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>##     
##      HSchool Grad or less Some college or AA degree Bachelor's or higher
##   0                  3424                         0                    0
##   1                  1679                         0                    0
##   2                  1633                         0                    0
##   3                  1787                         0                    0
##   4                  1716                         0                    0
##   5                  1822                         0                    0
##   6                  2726                         0                    0
##   7                  1860                         0                    0
##   8                  2644                         0                    0
##   9                  2908                         0                    0
##   10                 2884                         0                    0
##   11                 3186                         0                    0
##   12                 1774                         0                    0
##   13                 2290                         0                    0
##   14                18413                         0                    0
##   15                    0                     14822                    0
##   16                    0                      5413                    0
##   17                    0                      2966                    0
##   18                    0                         0                13883
##   19                    0                         0                 5956
##   20                    0                         0                  955
##   21                    0                         0                 1018
##   96                    0                         0                    0
##   97                    0                         0                    0
##   98                    0                         0                    0
##   99                    0                         0                    0
</code></pre>
</div>
</div>
<p>One easy way to see whether your recoding has had the desired effect is<br>
to make a simple table that maps the original values to the new values.<br>
That’s what I’ve done here for <strong>EDUCATION</strong> which shows the collapse of<br>
categories and the fact that values like 99 have been mapped to <code>NA</code>.</p>
<p>Finally let’s grab just the variables we really need including the newly<br>
recoded versions and make them a new dataset and take the full version<br>
out of<br>
memory.</p>
<div>
<div>
<pre><code><span>OfInterest</span><span> </span><span>&lt;-</span><span> </span><span>select</span><span>(</span><span>FullFile</span><span>,</span><span> </span><span>AGE</span><span>,</span><span> </span><span>REGION</span><span>,</span><span> </span><span>SEX</span><span>,</span><span> </span><span>EDUCATION</span><span>,</span><span> </span><span>EARNINGS</span><span>,</span><span> </span><span>PDMED12M</span><span>,</span><span> </span><span>PNMED12M</span><span>,</span><span> </span><span>NOTCOV</span><span>,</span><span> </span><span>MEDBILL</span><span>)</span><span>
</span><span>str</span><span>(</span><span>OfInterest</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>## 'data.frame':    103789 obs. of  9 variables:
##  $ AGE      : Factor w/ 3 levels &quot;Less than 18&quot;,..: 2 2 2 1 1 2 2 2 3 2 ...
##  $ REGION   : Factor w/ 4 levels &quot;Northeast&quot;,&quot;Midwest&quot;,..: 3 4 4 4 4 4 3 3 4 3 ...
##  $ SEX      : Factor w/ 2 levels &quot;Male&quot;,&quot;Female&quot;: 1 2 1 1 2 2 2 1 1 1 ...
##  $ EDUCATION: Factor w/ 3 levels &quot;HSchool Grad or less&quot;,..: 2 1 3 1 NA 3 1 1 3 2 ...
##  $ EARNINGS : Factor w/ 3 levels &quot;$01-$34,999&quot;,..: 1 2 2 NA NA 3 1 NA 2 3 ...
##  $ PDMED12M : Factor w/ 2 levels &quot;Yes&quot;,&quot;No&quot;: 2 1 2 2 2 2 2 2 2 2 ...
##  $ PNMED12M : Factor w/ 2 levels &quot;Yes&quot;,&quot;No&quot;: 2 2 2 2 2 2 2 2 2 2 ...
##  $ NOTCOV   : Factor w/ 2 levels &quot;Not covered&quot;,..: 2 2 2 2 2 2 2 2 2 2 ...
##  $ MEDBILL  : Factor w/ 2 levels &quot;Yes&quot;,&quot;No&quot;: 2 1 1 1 1 2 2 2 2 2 ...
</code></pre>
</div>
</div>
<div>
<div>
<pre><code><span>summary</span><span>(</span><span>OfInterest</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>##            AGE              REGION          SEX       
##  Less than 18:25680   Northeast:16883   Male  :50257  
##  18 to 60    :58025   Midwest  :20507   Female:53532  
##  More than 60:20084   South    :35826                 
##                       West     :30573                 
##                      EDUCATION                 EARNINGS     PDMED12M    
##  HSchool Grad or less     :50746   $01-$34,999     :20390   Yes : 6744  
##  Some college or AA degree:23201   $35,000-$74,999 :12927   No  :96986  
##  Bachelor's or higher     :21812   $75,000 and over: 6413   NA's:   59  
##  NA's                     : 8030   NA's            :64059               
##  PNMED12M             NOTCOV      MEDBILL     
##  Yes : 4978   Not covered:10506   Yes :16282  
##  No  :98741   Covered    :92181   No  :87096  
##  NA's:   70   NA's       : 1102   NA's:  411  
## 
</code></pre>
</div>
</div>
<div>
<div>
<pre><code><span>rm</span><span>(</span><span>FullFile</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<h2>Driving Excel</h2>
<p>Everything we have done so far has been in preparation for actually<br>
providing my colleague the data she wanted in Excel so now on to the<br>
main event. In this post I am deliberately going to <strong>NOT</strong> build<br>
functions or use <code>ggplot</code> to make the graphs she wanted. Those will be<br>
topics for future posts.</p>
<p>You may have noticed that a <code>table</code> is almost exactly what she wants. If<br>
the variables of interest are <code>AGE</code> and whether or not the person has<br>
health care coverage (<code>NOTCOV</code>) then the command would be<br>
<code>table(OfInterest$AGE,OfInterest$NOTCOV)</code> and we have results we need.<br>
The <code>openxlsx</code> package provides a <code>write.xlsx</code> function that will accept the<br>
table command and produce a properly formatted workbook as output. The<br>
code below will produce <code>SimpleExcelExample.xlsx</code> in your working<br>
directory. The number of options is legion and <code>?write.xlsx</code> will<br>
display them for you.</p>
<div>
<div>
<pre><code><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>AGE</span><span>,</span><span>OfInterest</span><span>$</span><span>NOTCOV</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>##               
##                Not covered Covered
##   Less than 18        1312   24193
##   18 to 60            8730   48484
##   More than 60         464   19504
</code></pre>
</div>
</div>
<div>
<div>
<pre><code><span>write.xlsx</span><span>(</span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>AGE</span><span>,</span><span>OfInterest</span><span>$</span><span>NOTCOV</span><span>),</span><span> </span><span>file</span><span> </span><span>=</span><span> </span><span>&quot;SimpleExcelExample.xlsx&quot;</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<h2>Finishing up the manual way</h2>
<p>The last thing I will describe in this post is how to make one workbook<br>
with multiple sheets. Where each sheet represents one variable pairing<br>
(e.g. <code>AGE</code> by <code>NOTCOV</code>). We’ll even label the tabs (worksheets) in a<br>
thoughtful way. So my colleague can easily see which sheet corresponds<br>
to which variable pairing.</p>
<p>The code below follows this pattern</p>
<ol>
<li>Create a new empty workbook object <code>wb &lt;- createWorkbook()</code></li>
<li>Invent a name for the <strong>tab</strong> or worksheet inside the workbook<br>
<code>NameofSheet</code></li>
<li>Make a <code>table</code> for a pair of variables <code>TheData &lt;-<br>
table(OfInterest$EDUCATION,OfInterest$NOTCOV)</code></li>
<li>Add a worksheet (tab) into the workbook <code>addWorksheet</code></li>
<li>Write the table we made onto the worksheet with <code>writeData</code></li>
<li>Repeat steps 2 through 5 <strong>12</strong> times</li>
</ol>
<p></p>
<div>
<div>
<pre><code><span>### Manual and painful way</span><span>
</span><span>## Create a new workbook</span><span>
</span><span>wb</span><span> </span><span>&lt;-</span><span> </span><span>createWorkbook</span><span>()</span><span>
</span><span># education by each of the other 4 variables</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;CoverageByEducation&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>EDUCATION</span><span>,</span><span>OfInterest</span><span>$</span><span>NOTCOV</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;MedbillByEducation&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>EDUCATION</span><span>,</span><span>OfInterest</span><span>$</span><span>MEDBILL</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;PDMED12MByEducation&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>EDUCATION</span><span>,</span><span>OfInterest</span><span>$</span><span>PDMED12M</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;PNMED12MByEducation&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>EDUCATION</span><span>,</span><span>OfInterest</span><span>$</span><span>PNMED12M</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span># earnings by each of the other 4 variables</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;CoverageByEarnings&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>EARNINGS</span><span>,</span><span>OfInterest</span><span>$</span><span>NOTCOV</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;MedbillByEarnings&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>EARNINGS</span><span>,</span><span>OfInterest</span><span>$</span><span>MEDBILL</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;PDMED12MByEarnings&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>EARNINGS</span><span>,</span><span>OfInterest</span><span>$</span><span>PDMED12M</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;PNMED12MByEarnings&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>EARNINGS</span><span>,</span><span>OfInterest</span><span>$</span><span>PNMED12M</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span># age by each of the other 4 variables</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;CoverageByAge&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>AGE</span><span>,</span><span>OfInterest</span><span>$</span><span>NOTCOV</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;MedbillByAge&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>AGE</span><span>,</span><span>OfInterest</span><span>$</span><span>MEDBILL</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;PDMED12MByAge&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>AGE</span><span>,</span><span>OfInterest</span><span>$</span><span>PDMED12M</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>NameofSheet</span><span> </span><span>&lt;-</span><span> </span><span>&quot;PNMED12MByAge&quot;</span><span>
</span><span>TheData</span><span> </span><span>&lt;-</span><span> </span><span>table</span><span>(</span><span>OfInterest</span><span>$</span><span>AGE</span><span>,</span><span>OfInterest</span><span>$</span><span>PNMED12M</span><span>)</span><span>
</span><span>addWorksheet</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheetName</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>)</span><span>
</span><span>writeData</span><span>(</span><span>wb</span><span> </span><span>=</span><span> </span><span>wb</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>NameofSheet</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>TheData</span><span>,</span><span> </span><span>borders</span><span> </span><span>=</span><span> </span><span>&quot;n&quot;</span><span>)</span><span>
</span><span>#</span><span>
</span><span>saveWorkbook</span><span>(</span><span>wb</span><span>,</span><span> </span><span>&quot;BetterExcelExample.xlsx&quot;</span><span>,</span><span> </span><span>overwrite</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>)</span><span> </span><span>## save to working directory</span><span>
</span></code></pre>
</div>
</div>
<h2>All done (not really)</h2>
<p>Hopefully this post helps you understand how to use the <code>openxlsx</code><br>
package to have <code>R</code> drive Excel to help you with your data analysis. In<br>
my next post I’ll build on this scaffolding to discuss how to make these<br>
very same graphs in <code>ggplot2</code> (which IMHO runs circles around Excel for<br>
scientific plotting), as well as making this all more efficient through<br>
the use of functions to take care of some of the more repetitive chores.</p>
<p>I hope you’ve found this useful. I am always open to comments,<br>
corrections and suggestions.</p>
<p>Chuck (ibecav at gmail dot<br>
com)</p>
<h3>License</h3>
<p><a rel="nofollow" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank"><img alt="Creative Commons License" src="https://i1.wp.com/i.creativecommons.org/l/by-sa/4.0/88x31.png?w=456&ssl=1" data-recalc-dims="1"></a><br>This<br>
work is licensed under a<br>
<a rel="nofollow" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative<br>
Commons Attribution-ShareAlike 4.0 International License</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://ibecav.github.io/RtoExcel/"> Chuck Powell</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/YuGVu_CMELo" height="1"></a></div>