Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Answers to the exercises are available here.
Exercise 1
Download and read into R a data set from 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.. Then take a look at it using head
.
Exercise 2
Load libraries to manipulate data like dplyr. Turn Ref_Date into a Date type variable. (Tip: use as.Date)
Exercise 3
Transform the variable “Value” to a numeric format.
- Learn indepth how to work with dplyr
- Get a full introduction to the data.table package
- And much more
Exercise 4
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.
Exercise 5
Create a text vector that contains the province names. Create a new data frame to store only lines with valid province names.
Exercise 6
We are interested in comparing unemployment rate between people born in canada and recent immigrants. Exclude lines related to other kinds of status.
Exercise 7
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.
Exercise 8
Take a look at the summary information of the unemployment rate.
Exercise 9
Use the summarize this data grouping then by status and province. Please, take the mean of the unemployment rate as the table content.
Exercise 10
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.
Related exercise sets:
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.