<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/canada-immigration-where-to-settle-in-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/05/26/canada-immigration-where-to-settle-in-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=canada-immigration-where-to-settle-in-exercises"> R-exercises</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a target="_blank" rel="nofollow" href="https://i0.wp.com/www.r-exercises.com/wp-content/uploads/2017/05/glowing-216042__340.jpg"><img sizes="(max-width: 150px) 100vw, 150px" alt="" class="wp-image-6152" src="https://i0.wp.com/www.r-exercises.com/wp-content/uploads/2017/05/glowing-216042__340-150x150.jpg?resize=150%2C150" data-recalc-dims="1"></a>Many people around the globe would like to immigrate to Canada as a Skilled Worker. These candidates must prove language proficiency in French and English, at least 2 years of working experience after graduation, and more. But, many immigrants that arrive in canada face unemployment rates sometimes even higher than in their original countries. So, the choice of the province to settle in is very important for those wishing to have economic success. With these exercises we will use R to analyze some immigration open data from Canadian government.</p>
<p>Answers to the exercises are available <a target="_blank" rel="nofollow" href="http://www.r-exercises.com/2017/05/26/canada-immigration-where-to-settle-in-solutions/">here</a>.</p>
<p><strong>Exercise 1</strong><br>
Download and read into R a data set from <a target="_blank" rel="nofollow" href="http://open.canada.ca/data/en/dataset/1c7c3efd-c990-4b96-8ecd-9e5eaee6b0bb">Labour force survey estimates (LFS), by immigrant status, age group, Canada, regions, provinces and Montreal, Toronto, Vancouver census metropolitan areas, 3-month moving average, unadjusted for seasonality.</a>. Then take a look at it using <code>head</code>.</p>
<p><strong>Exercise 2</strong><br>
Load libraries to manipulate data like dplyr. Turn Ref_Date into a Date type variable. (Tip: use as.Date)</p>
<p><strong>Exercise 3</strong><br>
Transform the variable “Value” to a numeric format.</p>
<div>
<aside><img src="http://www.r-exercises.com/2017/05/26/canada-immigration-where-to-settle-in-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=canada-immigration-where-to-settle-in-exercises"></aside>
<div><strong>Learn more</strong> about Data manipulation in the online course <a target="_blank" rel="nofollow" href="http://www.r-exercises.com/product/r-complete-data-analysis-solutions/"> R: Complete Data Analysis Solutions</a>. In this course you will learn how to:
<ul>
<li>Learn indepth how to work with dplyr</li>
<li>Get a full introduction to the data.table package</li>
<li>And much more</li>
</ul>
</div>
</div>
<p><strong>Exercise 4</strong><br>
Create a numeric vector that contains this column indices 1,2,4,5,6, and 9. And create a new data frame to store this data.</p>
<p><strong>Exercise 5</strong><br>
Create a text vector that contains the province names. Create a new data frame to store only lines with valid province names.</p>
<p><strong>Exercise 6</strong><br>
We are interested in comparing unemployment rate between people born in canada and recent immigrants. Exclude lines related to other kinds of status.</p>
<p><strong>Exercise 7</strong><br>
Skilled worker immigrants usually need to have a university degree and at least 2 year of professional experience. So, exclude lines in the “agegroup” variable with “15 years and over”, and remove this column.</p>
<p><strong>Exercise 8</strong><br>
Take a look at the summary information of the unemployment rate.</p>
<p><strong>Exercise 9</strong><br>
Use the summarize this data grouping then by status and province. Please, take the mean of the unemployment rate as the table content.</p>
<p><strong>Exercise 10</strong><br>
Use qplot from ggplot2 to create a plot and find the best province in terms of difference at unemployment rate between local people and recent immigrants.</p>
<div>
<h3>Related exercise sets:</h3>
<ol>
<li><a title="Cross Tabulation with Xtabs exercises" target="_blank" rel="nofollow" href="http://www.r-exercises.com/2016/05/12/cross-tabulation-with-xtabs-exercises/">Cross Tabulation with Xtabs exercises </a></li>
<li><a title="As.Date() Exercises" target="_blank" rel="nofollow" href="http://www.r-exercises.com/2016/07/14/as-date-exercises/">As.Date() Exercises </a></li>
<li><a title="Building Shiny App Exercises (part-9)" target="_blank" rel="nofollow" href="http://www.r-exercises.com/2017/04/01/building-shiny-app-exercises-part-9/">Building Shiny App Exercises (part-9) </a></li>
<li><a target="_blank" rel="nofollow" href="http://www.r-exercises.com/start-here-to-learn-r/">Explore all our (>1000) R exercises</a></li>
<li><a target="_blank" rel="nofollow" href="http://www.r-exercises.com/r-courses/">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/05/26/canada-immigration-where-to-settle-in-exercises/?utm_source=rss&utm_medium=rss&utm_campaign=canada-immigration-where-to-settle-in-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 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/F0xp9U-sl1M"></a></div>