<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/encoding-categorical-variables-one-hot-and-beyond/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.win-vector.com/blog/2017/04/encoding-categorical-variables-one-hot-and-beyond/"> R – Win-Vector Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h2>(or: how to correctly use <code>xgboost</code> from <code>R</code>)</h2>
<p><a target="_blank" rel="nofollow" href="https://cran.r-project.org/"><code>R</code></a> has &quot;one-hot&quot; encoding hidden in most of its modeling paths. Asking an <code>R</code> user where one-hot encoding is used is like asking a fish where there is water; they can’t point to it as it is everywhere.</p>
<p>For example we can see evidence of one-hot encoding in the variable names chosen by a linear regression:</p>
<div>
<pre><code>dTrain &lt;-<span> </span><span>data.frame</span>(<span>x=</span> <span>c</span>(<span>'a'</span>,<span>'b'</span>,<span>'b'</span>, <span>'c'</span>),
                      <span>y=</span> <span>c</span>(<span>1</span>, <span>2</span>, <span>1</span>, <span>2</span>))
<span>summary</span>(<span>lm</span>(y~x, <span>data=</span> dTrain))</code></pre>
</div>
<pre><code>## 
## Call:
## lm(formula = y ~ x, data = dTrain)
## 
## Residuals:
##          1          2          3          4 
## -2.914e-16  5.000e-01 -5.000e-01  2.637e-16 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)   1.0000     0.7071   1.414    0.392
## xb            0.5000     0.8660   0.577    0.667
## xc            1.0000     1.0000   1.000    0.500
## 
## Residual standard error: 0.7071 on 1 degrees of freedom
## Multiple R-squared:    0.5,  Adjusted R-squared:   -0.5 
## F-statistic:   0.5 on 2 and 1 DF,  p-value: 0.7071</code></pre>
<p><span></span></p>
<p>Much of the encoding in <code>R</code> is essentially based on &quot;contrasts&quot; implemented in <code>stats::model.matrix()</code> Note: do not use <code>base::data.matrix()</code> or use <a target="_blank" rel="nofollow" href="http://www.win-vector.com/blog/2014/12/a-comment-on-preparing-data-for-classifiers/">hashing</a> before modeling- you might get away with them (especially with tree based methods), but they are <a target="_blank" rel="nofollow" href="http://www.win-vector.com/blog/2014/12/a-comment-on-preparing-data-for-classifiers/">not in general good technique</a> as we show below:</p>
<div>
<pre><code><span>data.matrix</span>(dTrain)</code></pre>
</div>
<pre><code>##      x y
## [1,] 1 1
## [2,] 2 2
## [3,] 2 1
## [4,] 3 2</code></pre>
<p><code>stats::model.matrix()</code> does not store its one-hot plan in a convenient manner (it can be inferred by pulling the &quot;<code>contrasts</code>&quot; attribute plus examining the column names of the first encoding, but the levels identified are not conveniently represented). When directly applying <code>stats::model.matrix()</code> you can not safely assume the same formula applied to two different data sets (say train and application or test) are using the same encoding! We demonstrate this below:</p>
<div>
<pre><code>dTrain &lt;-<span> </span><span>data.frame</span>(<span>x=</span> <span>c</span>(<span>'a'</span>,<span>'b'</span>,<span>'c'</span>), 
                     <span>stringsAsFactors =</span> <span>FALSE</span>)
encTrain &lt;-<span> </span>stats::<span>model.matrix</span>(~x, dTrain)
<span>print</span>(encTrain)</code></pre>
</div>
<pre><code>##   (Intercept) xb xc
## 1           1  0  0
## 2           1  1  0
## 3           1  0  1
## attr(,&quot;assign&quot;)
## [1] 0 1 1
## attr(,&quot;contrasts&quot;)
## attr(,&quot;contrasts&quot;)$x
## [1] &quot;contr.treatment&quot;</code></pre>
<div>
<pre><code>dTest &lt;-<span> </span><span>data.frame</span>(<span>x=</span> <span>c</span>(<span>'b'</span>,<span>'c'</span>), 
                     <span>stringsAsFactors =</span> <span>FALSE</span>)
stats::<span>model.matrix</span>(~x, dTest)</code></pre>
</div>
<pre><code>##   (Intercept) xc
## 1           1  0
## 2           1  1
## attr(,&quot;assign&quot;)
## [1] 0 1
## attr(,&quot;contrasts&quot;)
## attr(,&quot;contrasts&quot;)$x
## [1] &quot;contr.treatment&quot;</code></pre>
<p>The above mal-coding can be a critical flaw when you are building a model and then later using the model on new data (be it cross-validation data, test data, or future application data). Many <code>R</code> users are not familiar with the above issue as encoding is hidden in model training, and how to encode new data is stored as part of the model. <code>Python</code> <code>scikit-learn</code> users coming to <code>R</code> often ask &quot;where is the one-hot encoder&quot; (as it isn’t discussed as much in <code>R</code> as it is in <code>scikit-learn</code>) and even supply a number of (low quality) one-off packages &quot;porting one-hot encoding to <code>R</code>.&quot;</p>
<p>The main place an <code>R</code> user needs a proper encoder (and that is an encoder that stores its encoding plan in a conveniently re-usable form, which many of the &quot;one-off ported from <code>Python</code>&quot; packages actually fail to do) is when using a machine learning implementation that isn’t completely <code>R</code>-centric. One such system is <a target="_blank" rel="nofollow" href="https://github.com/dmlc/xgboost"><code>xgboost</code></a> which requires (as is typical of machine learning in <code>scikit-learn</code>) data to already be encoded as a numeric matrix (instead of a heterogeneous structure such as a <code>data.frame</code>). This requires explicit conversion on the part of the <code>R</code> user, and many <code>R</code> users get it wrong (fail to store the encoding plan somewhere). To make this concrete let’s work a simple example.</p>
<p>Let’s try the Titanic data set to see encoding in action. Note: we are not working hard on this example (as in adding extra variables derived from cabin layout, commonality of names, and other sophisticated feature transforms)- just plugging the obvious variable into <code>xgboost</code>. As we said: <code>xgboost</code> requires a numeric matrix for its input, so unlike many <code>R</code> modeling methods we must manage the data encoding ourselves (instead of leaving that to <code>R</code> which often hides the encoding plan in the trained model). Also note: differences observed in performance that are below the the sampling noise level should not be considered significant (e.g., all the methods demonstrated here performed about the same).</p>
<p>We bring in our data:</p>
<div>
<pre><code><span># set up example data set</span>
<span>library</span>(<span>&quot;titanic&quot;</span>)
<span>data</span>(titanic_train)
<span>str</span>(titanic_train)</code></pre>
</div>
<pre><code>## 'data.frame':    891 obs. of  12 variables:
##  $ PassengerId: int  1 2 3 4 5 6 7 8 9 10 ...
##  $ Survived   : int  0 1 1 1 0 0 0 0 1 1 ...
##  $ Pclass     : int  3 1 3 1 3 3 1 3 3 2 ...
##  $ Name       : chr  &quot;Braund, Mr. Owen Harris&quot; &quot;Cumings, Mrs. John Bradley (Florence Briggs Thayer)&quot; &quot;Heikkinen, Miss. Laina&quot; &quot;Futrelle, Mrs. Jacques Heath (Lily May Peel)&quot; ...
##  $ Sex        : chr  &quot;male&quot; &quot;female&quot; &quot;female&quot; &quot;female&quot; ...
##  $ Age        : num  22 38 26 35 35 NA 54 2 27 14 ...
##  $ SibSp      : int  1 1 0 1 0 0 0 3 0 1 ...
##  $ Parch      : int  0 0 0 0 0 0 0 1 2 0 ...
##  $ Ticket     : chr  &quot;A/5 21171&quot; &quot;PC 17599&quot; &quot;STON/O2. 3101282&quot; &quot;113803&quot; ...
##  $ Fare       : num  7.25 71.28 7.92 53.1 8.05 ...
##  $ Cabin      : chr  &quot;&quot; &quot;C85&quot; &quot;&quot; &quot;C123&quot; ...
##  $ Embarked   : chr  &quot;S&quot; &quot;C&quot; &quot;S&quot; &quot;S&quot; ...</code></pre>
<div>
<pre><code><span>summary</span>(titanic_train)</code></pre>
</div>
<pre><code>##   PassengerId       Survived          Pclass          Name          
##  Min.   :  1.0   Min.   :0.0000   Min.   :1.000   Length:891        
##  1st Qu.:223.5   1st Qu.:0.0000   1st Qu.:2.000   Class :character  
##  Median :446.0   Median :0.0000   Median :3.000   Mode  :character  
##  Mean   :446.0   Mean   :0.3838   Mean   :2.309                     
##  3rd Qu.:668.5   3rd Qu.:1.0000   3rd Qu.:3.000                     
##  Max.   :891.0   Max.   :1.0000   Max.   :3.000                     
##                                                                     
##      Sex                 Age            SibSp           Parch       
##  Length:891         Min.   : 0.42   Min.   :0.000   Min.   :0.0000  
##  Class :character   1st Qu.:20.12   1st Qu.:0.000   1st Qu.:0.0000  
##  Mode  :character   Median :28.00   Median :0.000   Median :0.0000  
##                     Mean   :29.70   Mean   :0.523   Mean   :0.3816  
##                     3rd Qu.:38.00   3rd Qu.:1.000   3rd Qu.:0.0000  
##                     Max.   :80.00   Max.   :8.000   Max.   :6.0000  
##                     NA's   :177                                     
##     Ticket               Fare           Cabin             Embarked        
##  Length:891         Min.   :  0.00   Length:891         Length:891        
##  Class :character   1st Qu.:  7.91   Class :character   Class :character  
##  Mode  :character   Median : 14.45   Mode  :character   Mode  :character  
##                     Mean   : 32.20                                        
##                     3rd Qu.: 31.00                                        
##                     Max.   :512.33                                        
## </code></pre>
<div>
<pre><code>outcome &lt;-<span> 'Survived'</span>
target &lt;-<span> </span><span>1</span>
shouldBeCategorical &lt;-<span> </span><span>c</span>(<span>'PassengerId'</span>, <span>'Pclass'</span>, <span>'Parch'</span>)
for(v in shouldBeCategorical) {
  titanic_train[[v]] &lt;-<span> </span><span>as.factor</span>(titanic_train[[v]])
}
tooDetailed &lt;-<span> </span><span>c</span>(<span>&quot;Ticket&quot;</span>, <span>&quot;Cabin&quot;</span>, <span>&quot;Name&quot;</span>, <span>&quot;PassengerId&quot;</span>)
vars &lt;-<span> </span><span>setdiff</span>(<span>colnames</span>(titanic_train), <span>c</span>(outcome, tooDetailed))

dTrain &lt;-<span> </span>titanic_train</code></pre>
</div>
<p>And design our cross-validated modeling experiment:</p>
<div>
<pre><code><span>library</span>(<span>&quot;xgboost&quot;</span>)
<span>library</span>(<span>&quot;sigr&quot;</span>)
<span>library</span>(<span>&quot;WVPlots&quot;</span>)
<span>library</span>(<span>&quot;vtreat&quot;</span>)

<span>set.seed</span>(<span>4623762</span>)
crossValPlan &lt;-<span> </span>vtreat::<span>kWayStratifiedY</span>(<span>nrow</span>(dTrain), 
                                        <span>10</span>, 
                                        dTrain, 
                                        dTrain[[outcome]])

evaluateModelingProcedure &lt;-<span> </span>function(xMatrix, outcomeV, crossValPlan) {
  preds &lt;-<span> </span><span>rep</span>(<span>NA_real_</span>, <span>nrow</span>(xMatrix))
  for(ci in crossValPlan) {
    nrounds &lt;-<span> </span><span>1000</span>
    cv &lt;-<span> </span><span>xgb.cv</span>(<span>data=</span> xMatrix[ci$train, ],
                 <span>label=</span> outcomeV[ci$train],
                 <span>objective=</span> <span>'binary:logistic'</span>,
                 <span>nrounds=</span> nrounds,
                 <span>verbose=</span> <span>0</span>,
                 <span>nfold=</span> <span>5</span>)
    <span>#nrounds &lt;- which.min(cv$evaluation_log$test_rmse_mean) # regression</span>
    nrounds  &lt;-<span> </span><span>which.min</span>(cv$evaluation_log$test_error_mean) <span># classification</span>
    model &lt;-<span> </span><span>xgboost</span>(<span>data=</span> xMatrix[ci$train, ],
                     <span>label=</span> outcomeV[ci$train],
                     <span>objective=</span> <span>'binary:logistic'</span>,
                     <span>nrounds=</span> nrounds,
                     <span>verbose=</span> <span>0</span>)
    preds[ci$app] &lt;-<span> </span><span>predict</span>(model, xMatrix[ci$app, ])
  }
  preds
}</code></pre>
</div>
<p>Our preferred way to encode data is to use the <a target="_blank" rel="nofollow" href="https://cran.r-project.org/package=vtreat"><code>vtreat</code></a> package in the &quot;no variables mode&quot; shown below (differing from the powerful &quot;y aware&quot; modes we usually teach).</p>
<div>
<pre><code><span>set.seed</span>(<span>4623762</span>)
tplan &lt;-<span> </span>vtreat::<span>designTreatmentsZ</span>(dTrain, vars, 
                                   <span>minFraction=</span> <span>0</span>,
                                   <span>verbose=</span><span>FALSE</span>)
<span># restrict to common varaibles types</span>
<span># see vignette('vtreatVariableTypes', package = 'vtreat') for details</span>
sf &lt;-<span> </span>tplan$scoreFrame
newvars &lt;-<span> </span>sf$varName[sf$code %in%<span> </span><span>c</span>(<span>&quot;lev&quot;</span>, <span>&quot;clean&quot;</span>, <span>&quot;isBAD&quot;</span>)] 
trainVtreat &lt;-<span> </span><span>as.matrix</span>(vtreat::<span>prepare</span>(tplan, dTrain, 
                                         <span>varRestriction =</span> newvars))
<span>print</span>(<span>dim</span>(trainVtreat))</code></pre>
</div>
<pre><code>## [1] 891  20</code></pre>
<div>
<pre><code><span>print</span>(<span>colnames</span>(trainVtreat))</code></pre>
</div>
<pre><code>##  [1] &quot;Pclass_lev_x.1&quot;   &quot;Pclass_lev_x.2&quot;   &quot;Pclass_lev_x.3&quot;  
##  [4] &quot;Sex_lev_x.female&quot; &quot;Sex_lev_x.male&quot;   &quot;Age_clean&quot;       
##  [7] &quot;Age_isBAD&quot;        &quot;SibSp_clean&quot;      &quot;Parch_lev_x.0&quot;   
## [10] &quot;Parch_lev_x.1&quot;    &quot;Parch_lev_x.2&quot;    &quot;Parch_lev_x.3&quot;   
## [13] &quot;Parch_lev_x.4&quot;    &quot;Parch_lev_x.5&quot;    &quot;Parch_lev_x.6&quot;   
## [16] &quot;Fare_clean&quot;       &quot;Embarked_lev_x.&quot;  &quot;Embarked_lev_x.C&quot;
## [19] &quot;Embarked_lev_x.Q&quot; &quot;Embarked_lev_x.S&quot;</code></pre>
<div>
<pre><code>dTrain$predVtreatZ &lt;-<span> </span><span>evaluateModelingProcedure</span>(trainVtreat,
                                                       dTrain[[outcome]]==target,
                                                       crossValPlan)
sigr::<span>permTestAUC</span>(dTrain, 
                  <span>'predVtreatZ'</span>,
                  outcome, target)</code></pre>
</div>
<pre><code>## [1] &quot;AUC test alt. hyp. AUC>AUC(permuted): (AUC=0.86, s.d.=0.017, p&lt;1e-05).&quot;</code></pre>
<div>
<pre><code>WVPlots::<span>ROCPlot</span>(dTrain, 
                 <span>'predVtreatZ'</span>, 
                 outcome, target, 
                 <span>'vtreat encoder performance'</span>)</code></pre>
</div>
<div>
<img alt="" src="https://i1.wp.com/www.win-vector.com/blog/wp-content/uploads/2017/04/vtreatZ-1.png?w=660" data-recalc-dims="1">
</div>
<p>Model matrix can perform similar encoding <em>when</em> we only have a single data set.</p>
<div>
<pre><code><span>set.seed</span>(<span>4623762</span>)
f &lt;-<span> </span><span>paste</span>(<span>'~ 0 + '</span>, <span>paste</span>(vars, <span>collapse =</span> <span>' + '</span>))
<span># model matrix skips rows with NAs by default,</span>
<span># get control of this through an option</span>
oldOpt &lt;-<span> </span><span>getOption</span>(<span>'na.action'</span>)
<span>options</span>(<span>na.action=</span><span>'na.pass'</span>)
trainModelMatrix &lt;-<span> </span>stats::<span>model.matrix</span>(<span>as.formula</span>(f), 
                                  dTrain)
<span># note model.matrix does not conveniently store the encoding</span>
<span># plan, so you may run into difficulty if you were to encode</span>
<span># new data which didn't have all the levels seen in the training</span>
<span># data.</span>
<span>options</span>(<span>na.action=</span>oldOpt)
<span>print</span>(<span>dim</span>(trainModelMatrix))</code></pre>
</div>
<pre><code>## [1] 891  16</code></pre>
<div>
<pre><code><span>print</span>(<span>colnames</span>(trainModelMatrix))</code></pre>
</div>
<pre><code>##  [1] &quot;Pclass1&quot;   &quot;Pclass2&quot;   &quot;Pclass3&quot;   &quot;Sexmale&quot;   &quot;Age&quot;      
##  [6] &quot;SibSp&quot;     &quot;Parch1&quot;    &quot;Parch2&quot;    &quot;Parch3&quot;    &quot;Parch4&quot;   
## [11] &quot;Parch5&quot;    &quot;Parch6&quot;    &quot;Fare&quot;      &quot;EmbarkedC&quot; &quot;EmbarkedQ&quot;
## [16] &quot;EmbarkedS&quot;</code></pre>
<div>
<pre><code>dTrain$predModelMatrix &lt;-<span> </span><span>evaluateModelingProcedure</span>(trainModelMatrix,
                                                     dTrain[[outcome]]==target,
                                                     crossValPlan)
sigr::<span>permTestAUC</span>(dTrain, 
                  <span>'predModelMatrix'</span>,
                  outcome, target)</code></pre>
</div>
<pre><code>## [1] &quot;AUC test alt. hyp. AUC>AUC(permuted): (AUC=0.87, s.d.=0.019, p&lt;1e-05).&quot;</code></pre>
<div>
<pre><code>WVPlots::<span>ROCPlot</span>(dTrain, 
                 <span>'predModelMatrix'</span>, 
                 outcome, target, 
                 <span>'model.matrix encoder performance'</span>)</code></pre>
</div>
<div>
<img alt="" src="https://i1.wp.com/www.win-vector.com/blog/wp-content/uploads/2017/04/modelmatrix-1.png?w=660" data-recalc-dims="1">
</div>
<p>The <code>caret</code> package also supplies an encoding functionality properly split between training (<code>caret::dummyVars()</code>) and application (called <code>predict()</code>).</p>
<div>
<pre><code><span>library</span>(<span>&quot;caret&quot;</span>)</code></pre>
</div>
<pre><code>## Loading required package: lattice

## Loading required package: ggplot2</code></pre>
<div>
<pre><code><span>set.seed</span>(<span>4623762</span>)
f &lt;-<span> </span><span>paste</span>(<span>'~'</span>, <span>paste</span>(vars, <span>collapse =</span> <span>' + '</span>))
encoder &lt;-<span> </span>caret::<span>dummyVars</span>(<span>as.formula</span>(f), dTrain)
trainCaret &lt;-<span> </span><span>predict</span>(encoder, dTrain)
<span>print</span>(<span>dim</span>(trainCaret))</code></pre>
</div>
<pre><code>## [1] 891  19</code></pre>
<div>
<pre><code><span>print</span>(<span>colnames</span>(trainCaret))</code></pre>
</div>
<pre><code>##  [1] &quot;Pclass.1&quot;  &quot;Pclass.2&quot;  &quot;Pclass.3&quot;  &quot;Sexfemale&quot; &quot;Sexmale&quot;  
##  [6] &quot;Age&quot;       &quot;SibSp&quot;     &quot;Parch.0&quot;   &quot;Parch.1&quot;   &quot;Parch.2&quot;  
## [11] &quot;Parch.3&quot;   &quot;Parch.4&quot;   &quot;Parch.5&quot;   &quot;Parch.6&quot;   &quot;Fare&quot;     
## [16] &quot;Embarked&quot;  &quot;EmbarkedC&quot; &quot;EmbarkedQ&quot; &quot;EmbarkedS&quot;</code></pre>
<div>
<pre><code>dTrain$predCaret &lt;-<span> </span><span>evaluateModelingProcedure</span>(trainCaret,
                                                     dTrain[[outcome]]==target,
                                                     crossValPlan)
sigr::<span>permTestAUC</span>(dTrain, 
                  <span>'predCaret'</span>,
                  outcome, target)</code></pre>
</div>
<pre><code>## [1] &quot;AUC test alt. hyp. AUC>AUC(permuted): (AUC=0.85, s.d.=0.017, p&lt;1e-05).&quot;</code></pre>
<div>
<pre><code>WVPlots::<span>ROCPlot</span>(dTrain, 
                 <span>'predCaret'</span>, 
                 outcome, target, 
                 <span>'caret encoder performance'</span>)</code></pre>
</div>
<div>
<img alt="" src="https://i2.wp.com/www.win-vector.com/blog/wp-content/uploads/2017/04/caret-1.png?w=660" data-recalc-dims="1">
</div>
<p>We usually forget to teach <code>vtreat::designTreatmentsZ()</code> as it is often dominated by the more powerful y-aware methods <code>vtreat</code> supplies (though not for this simple example). <code>vtreat::designTreatmentsZ</code> has a number of useful properties:</p>
<ul>
<li>Does not look at the outcome values, so does not require extra care in cross-validation.</li>
<li>Saves its encoding, so can be used correctly on new data.</li>
</ul>
<p>The above two properties are shared with <code>caret::dummyVars()</code>. Additional features of <code>vtreat::designTreatmentsZ</code> (that differ from <code>caret::dummyVars()</code>‘s choices) include:</p>
<ul>
<li>No <code>NA</code> values are passed through by <code>vtreat::prepare()</code>.</li>
<li><code>NA</code> presence is added as an additional informative column.</li>
<li>A few derived columns (such as pooling of rare levels are made available).</li>
<li>Rare dummy variables are pruned (under a user-controlled threshold) to prevent encoding explosion.</li>
<li>Novel levels (levels that occur during test or application, but not during training) are deliberately passed through as &quot;no training level activated&quot; by <code>vtreat::prepare()</code> (<code>caret::dummyVars()</code> considers this an error).</li>
</ul>
<p>The <code>vtreat</code> y-aware methods include proper nested modeling and y-aware dimension reduction.</p>
<p><code>vtreat</code> is designed &quot;to always work&quot; (always return a pure numeric data frame with no missing values). It also excels in &quot;big data&quot; situations where the statistics it can collect on high cardinality categorical variables can have a huge positive impact in modeling performance. In many cases <code>vtreat</code> works around problems that kill the analysis pipeline (such as discovering new variable levels during test or application). We teach <code>vtreat</code> sore of &quot;bimodally&quot; in both a <a target="_blank" rel="nofollow" href="http://www.win-vector.com/blog/2017/03/vtreat-prepare-data/">&quot;fire and forget&quot; mode</a> and a <a target="_blank" rel="nofollow" href="https://arxiv.org/abs/1611.09477">&quot;all the details on deck&quot; mode</a> (suitable for formal citation). Either way <code>vtreat</code> can make your modeling procedures stronger, more reliable, and easier.</p>
<p>All code for this article can be found <a target="_blank" rel="nofollow" href="https://github.com/WinVector/Examples/tree/master/Encoding">here</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://www.win-vector.com/blog/2017/04/encoding-categorical-variables-one-hot-and-beyond/"> R – Win-Vector Blog</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/IbsBcuskrX0"></a></div>