<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/nyc-buses-company-level-predictors-with-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://datascienceplus.com/nyc-buses-company-level-predictors-with-r/"> R Programming – DataScience+</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<ul></ul>
<p><strong>
<p>Categories</p>
<p></p></strong>
<ol>
<li><a rel="nofollow" href="https://datascienceplus.com/category/basic-statistics/" title="Permanent Link toBasic Statistics" target="_blank">Basic Statistics</a></li>
</ol>
<p><strong>
<p>Tags</p>
<p></p></strong>
<ol>
<li><a rel="nofollow" href="https://datascienceplus.com/tag/data-management/" title="Permanent Link toData Management" target="_blank">Data Management</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/tag/rstats/" title="Permanent Link toR Programming" target="_blank">R Programming</a></li>
</ol>
<p>We are following on from our <a rel="nofollow" href="https://datascienceplus.com/nyc-bus-delays/" target="_blank">previously loaded data of NYC bus delays</a>, and from our simple Cubist regression fit. We know that we need to add in more predictors, and we have access to company level data. A warning to the faint-hearted: this post is essentially all data manipulation and joins. No pretty graphs, no conclusions. I am documenting the slog because the slog is required. We will move on to better things afterwards.</p>
<h2>Preparation of company and route level data</h2>
<p>We read in all of our data and take a look:</p>
<pre><code>#---II_Breakdown_and_Delays
##NR: this actually isn't what I want here. Where is the other data?
in_csv &lt;- &quot;../data/II_Bus_Breakdown_and_Delays.csv&quot;
ii_breakdowns &lt;- read_csv(in_csv)
ii_breakdowns %>% glimpse</code>
<em>## Observations: 259,637
## Variables: 21
## $ School_Year </em></pre>