Question: Section 1 : write a R script to complete the following tasks on data cleaning and descriptive statistics: Set the R working directory on your
Section : write a R script to complete the following tasks on data cleaning and descriptive statistics:
Set the R working directory on your computer.
Import "airquality" data from any of the format: Rdata, csv or txt and name it as raw.
Change variable name "Solar.R to "SolarRadiation"
Get mean ozone level for the following sample or subsamples.
the overall mean Ozone level for the entire samplemean ozone level when Temp is no higher than langmean ozone level when Temp is higher than but below langmean ozone level when Temp is above lang but wind is no higher than miles per hour
Create a histogram for Ozone level.
Calculate the variance and the standard deviation of Ozone
Get a subsample of data with no missing value for Ozone variable using naomit function and name the new data as rawnoNA Feel free to copy, paste, and run the following code to your script: rawnoNA naomitinsert the name of your data You can read for details about theomit functionLinks to an external site..
Calculate correlation coefficients for the following three pairs:
Ozone with WindOzone with TempOzone with SolarRadiation
Calculate a complex mean Ozone level for each month and make a bar plot.
Tabulate variable MonthUse function tapply to generate mean ozone level for each monthGenerate a bar plot for monthly mean ozone levels.Assign the title of the bar plot as Ozone level by MonthLabel x axis as MonthLabel y axis as Mean Ozone LevelUse rainbow color or heat colors for the barsAdd the value of May, June, July, August, September to the x axis.
Generate an xy plot for Ozone and Solar Radiation.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
