Clean the Excel fifile so that it is structured like a normal wide-format data frame with four variables, the date, and ···
Download the all-items monthly Consumer Price Index for Quebec, Ontario, Alberta, and BC, January 2010 to June 2020. Calculate the 12 month inflflation rates (you will lose January 2010 to December 2010 in the process). Clean the Excel fifile so that it is structured like a normal wide-format data frame with four variables, the date, and the inflflation rate for each of the four provinces. Save it as a .csv fifile.
1.Readthe file and print the first six and last six observations.
2.Writea function to calculate the coefficient of variation as per equation 8 in the lec- ture notes.
3.Reshape the data into long format using the melt function, and rename value to be “inflation”and variable to be “province”. Print the first six observations.
4.Usethe aggregate function to create a table of mean, median, and coefficient of varia- tion, for the four provinces.
5.From the four-province inflflation data use ggplot2 to produce a time series chart with the four provincial inflflation rates plotted against Date, by modifying the code on page 42 of the notes.
6.Repeat#5, but this time change the geom from line to point with size 5 for all provinces but BC, and change the theme from theme_economist() to theme().
Download the annual total, all industries, both sexes, 15 yrs and over unemployment rate for Newfoundland and Labrador, Quebec, Ontario, Alberta, and BC, 2000 to 2019. Clean the Excel fifile so that it is structured like a normal wide-format data frame with six variables, the year, and the unemployment rate for each of the fifive provinces. Save it as a .CSV fifile.
7.Readthe file and print the first six and last six observations.
8.Createa scatterplot matrix for the unemployment rates in the five provinces.
9.Createside-by-side boxplots of unemployment rates in the five provinces.
10.Createside-by-side beanplots of unemployment rates in the five provinces.