<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/big-data-manipulation-in-r-exercises/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.r-exercises.com/2017/06/09/big-data-manipulation-in-r-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=big-data-manipulation-in-r-exercises"> R-exercises</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a rel="nofollow" href="https://i1.wp.com/www.r-exercises.com/wp-content/uploads/2017/05/snip2.png" target="_blank"><img sizes="(max-width: 150px) 100vw, 150px" src="https://i2.wp.com/www.r-exercises.com/wp-content/uploads/2017/05/snip2-150x150.png?resize=150%2C150" alt="" class="wp-image-6058" data-recalc-dims="1"></a><br>
Some times it is necessary to download really big csv files to deliver some analysis. When you hit file sizes in Gigabytes it is useful to use R instead of spreadsheets. This exercise teaches us to manipulate this kind of files.</p>
<p>Answers to the exercises are available <a rel="nofollow" href="http://www.r-exercises.com/2017/06/09/big-data-manipulation-in-r-solutions/" target="_blank">here</a>.</p>
<p><strong>Exercise 1</strong><br>
Create a directory canada immigration/Work/Income and put all files related to income then load dplyr.<br>
Download data set from <a rel="nofollow" href="http://open.canada.ca/data/en/dataset?q=&sort=" target="_blank">here</a>. </p>
<p><strong>Exercise 2</strong><br>
Create a string vector with file names: 00540002-eng, 00540005-eng, 00540007-eng, 00540009-eng, 00540011-eng, 00540013-eng, 00540015-eng, and 00540017-eng.</p>
<p><strong>Exercise 3</strong><br>
Create a list of data frames and put the data of each file in list position. For example, <code>data[[1]]</code> will contain the first file. To reduce this data size, for each data set select only data from 2014.</p>
<p><strong>Exercise 4</strong><br>
Clean up the first data sets in the list (data[[1]]) and exclude registers that summarizes other like: “Both sexes” to avoid double operations while summarizing.</p>
<p><strong>Exercise 5</strong><br>
Clean up all other data sets in the list and exclude registers the same way discribed at exercise 4. Then, pile up all data in a sigle data set. </p>
<div>
<aside><img src="http://www.r-exercises.com/2017/06/09/big-data-manipulation-in-r-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=big-data-manipulation-in-r-exercises"></aside>
<div><strong>Learn more</strong> about Data Pre-Processing in the online course <a rel="nofollow" href="http://www.r-exercises.com/product/r-data-pre-processing-data-management-shape-your-data/" target="_blank">R Data Pre-Processing &amp; Data Management – Shape your Data!</a>. In this course you will learn how to:
<ul>
<li>import data into R in several ways while also beeing able to identify a suitable import tool</li>
<li>use SQL code within R</li>
<li>And much more</li>
</ul>
</div>
</div>
<p><strong>Exercise 6</strong><br>
Write a csv file with the recent create data set.</p>
<p><strong>Exercise 7</strong><br>
Create a directory canada immigration/Work/Income and put all files related to income then load dplyr.<br>
Download data set from <a rel="nofollow" href="http://open.canada.ca/data/en/dataset/1c7c3efd-c990-4b96-8ecd-9e5eaee6b0bb" target="_blank">here</a>.<br>
Create a string vector with file names: 00540018-eng, 00540019-eng, 00540020-eng, 00540021-eng, 00540022-eng, 00540023-eng, 00540024-eng, and 00540025-eng.<br>
Create a list of data frames and put the data of each file in list position. For example, <code>data[[1]]</code> will contain the first file. To reduce this data size, for each data set select only data from 2014.</p>
<p><strong>Exercise 8</strong><br>
Clean up the first data sets in the list (data[[1]]) and exclude registers that summarizes other like: “Both sexes” to avoid double operations while summarizing.</p>
<p><strong>Exercise 9</strong><br>
Clean up all other data sets in the list and exclude registers the same way discribed at exercise 8. Then, pile up all data in a sigle data set. </p>
<p><strong>Exercise 10</strong><br>
Write a csv file with the recent create data set.</p>
<div>
<h3>Related exercise sets:</h3>
<ol>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/05/05/forecasting-arimax-model-exercises-part-5/" title="Forecasting: ARIMAX Model Exercises (Part-5)" target="_blank">Forecasting: ARIMAX Model Exercises (Part-5) </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/05/24/data-wrangling-part-1-io/" title="Data wrangling : I/O (Part-1)" target="_blank">Data wrangling : I/O (Part-1) </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/2016/02/22/bind-exercises/" title="Bind exercises" target="_blank">Bind exercises </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/start-here-to-learn-r/" target="_blank">Explore all our (>1000) R exercises</a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/r-courses/" target="_blank">Find an R course using our R Course Finder</a> directory</li>
</ol>
</div>
	<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.r-exercises.com/2017/06/09/big-data-manipulation-in-r-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=big-data-manipulation-in-r-exercises"> R-exercises</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/cZqlahqNgkw" height="1"></a></div>