Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This needs to be done in R. The question is on the left side and the right side is an example of the data set.

image text in transcribedThis needs to be done in R. The question is on the left side and the right side is an example of the data set. I can not upload files to this so I will show you the column headings.

X city pm25tmean2 pm 10tmean2 o3tmean2 no2tmean2 tmpd 31.5 1 1 chic NA 34.00000 4.250000 19.98810 dptp date 31.500 1987-01-01 29.875 1987-01-02 27.375 1987-01-03 2 2 chic 33.0 NA NA 3.304348 23.19099 3 3 chic 33.0 NA 34.16667 3.333333 23.81548 4 4 4 chic 29.0 28.625 1987-01-04 NA 47.00000 4.375000 30.43452 5 5 chic 32.0 28.875 1987-01-05 NA NA 4.750000 30.33333 6 6 chic 40.0 35.125 1987-01-06 NA 48.00000 5.833333 25.77233 7 7 7 7 chic 34.5 26.750 1987-01-07 NA 41.00000 9.291667 20.58171 8 8 chic 29.0 22.000 1987-01-08 NA 36.00000 11.291667 17.03723 Topic : The R Programming Language - Part 4 9 9 chic 26.5 29.000 1987-01-09 NA 33.28571 4.500000 23.38889 10 10 chic 32.5 27.750 1987-01-10 NA NA 4.958333 19.54167 Statistical Summaries 11 11 chic 29.5 20.125 1987-01-11 NA 17.541667 13.70139 22.00000 26.00000 12 12 chic 34,5 26.000 1987-01-12 NA 8.000000 33.02083 Homework 13 13 chic 34.0 32.250 1987-01-13 NA 53.00000 4.958333 38.06142 14 14 chic 37.5 36.375 1987-01-14 NA 43.00000 4.208333 32.19444 15 15 chic 32.5 24.250 1987-01-15 NA 4.458333 18.87131 Use the Chicago Data Set on Air Quality write a script to create two graph as follows: 28.83333 19.00000 16 16 chic 25.0 21.500 1987-01-16 NA 7.916667 19.46667 17 17 chic 27.0 24.750 1987-01-17 NA NA 5.833333 20.70833 18 18 chic 17.5 11.125 1987-01-18 NA 39.00000 6.375000 21.03333 19 19 chic 23.0 15.750 1987-01-19 NA 32.00000 14.875000 17.17409 20 20 chic 20.5 11.500 1987-01-20 NA 38.00000 7.250000 21.61021 1. Add a variable called year to the dataset. Hint: format(as.POSIXct(chicago$date), "%Y"). You have to re-attach dataset when you create new variables if you want to reference them. 2. Install and load "gridExtra package 3. Create two bar charts using 1. 03tmean2 as a function of year 2. No2tmean2 as a function of year 4. Apply the "summary_bin stat and define the y.fun as the mean 5. Plot the two graphs on the same plot with 03 stacked on top of the no2 graph. 21 21 chic 22.0 20.625 1987-01-21 NA 32.85714 8.913043 24.52083 22 22 chic 19.5 7.375 1987-01-22 NA 52.00000 10.500000 16.98798 23 23 chic 2.5 - 12.250 1987-01-23 NA 55.00000 14.625000 14.66250 Showing 1 to 23 of 6,940 entries Console Terminal X city pm25tmean2 pm 10tmean2 o3tmean2 no2tmean2 tmpd 31.5 1 1 chic NA 34.00000 4.250000 19.98810 dptp date 31.500 1987-01-01 29.875 1987-01-02 27.375 1987-01-03 2 2 chic 33.0 NA NA 3.304348 23.19099 3 3 chic 33.0 NA 34.16667 3.333333 23.81548 4 4 4 chic 29.0 28.625 1987-01-04 NA 47.00000 4.375000 30.43452 5 5 chic 32.0 28.875 1987-01-05 NA NA 4.750000 30.33333 6 6 chic 40.0 35.125 1987-01-06 NA 48.00000 5.833333 25.77233 7 7 7 7 chic 34.5 26.750 1987-01-07 NA 41.00000 9.291667 20.58171 8 8 chic 29.0 22.000 1987-01-08 NA 36.00000 11.291667 17.03723 Topic : The R Programming Language - Part 4 9 9 chic 26.5 29.000 1987-01-09 NA 33.28571 4.500000 23.38889 10 10 chic 32.5 27.750 1987-01-10 NA NA 4.958333 19.54167 Statistical Summaries 11 11 chic 29.5 20.125 1987-01-11 NA 17.541667 13.70139 22.00000 26.00000 12 12 chic 34,5 26.000 1987-01-12 NA 8.000000 33.02083 Homework 13 13 chic 34.0 32.250 1987-01-13 NA 53.00000 4.958333 38.06142 14 14 chic 37.5 36.375 1987-01-14 NA 43.00000 4.208333 32.19444 15 15 chic 32.5 24.250 1987-01-15 NA 4.458333 18.87131 Use the Chicago Data Set on Air Quality write a script to create two graph as follows: 28.83333 19.00000 16 16 chic 25.0 21.500 1987-01-16 NA 7.916667 19.46667 17 17 chic 27.0 24.750 1987-01-17 NA NA 5.833333 20.70833 18 18 chic 17.5 11.125 1987-01-18 NA 39.00000 6.375000 21.03333 19 19 chic 23.0 15.750 1987-01-19 NA 32.00000 14.875000 17.17409 20 20 chic 20.5 11.500 1987-01-20 NA 38.00000 7.250000 21.61021 1. Add a variable called year to the dataset. Hint: format(as.POSIXct(chicago$date), "%Y"). You have to re-attach dataset when you create new variables if you want to reference them. 2. Install and load "gridExtra package 3. Create two bar charts using 1. 03tmean2 as a function of year 2. No2tmean2 as a function of year 4. Apply the "summary_bin stat and define the y.fun as the mean 5. Plot the two graphs on the same plot with 03 stacked on top of the no2 graph. 21 21 chic 22.0 20.625 1987-01-21 NA 32.85714 8.913043 24.52083 22 22 chic 19.5 7.375 1987-01-22 NA 52.00000 10.500000 16.98798 23 23 chic 2.5 - 12.250 1987-01-23 NA 55.00000 14.625000 14.66250 Showing 1 to 23 of 6,940 entries Console Terminal

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mathematics Of Finance

Authors: Petr Zima

2nd Edition

0070082030, 9780070082038

More Books

Students also viewed these Accounting questions

Question

Write the following as a system ofequations: 0 2 28 16 X, 1 2

Answered: 1 week ago

Question

=+a) What kind of design or study is this?

Answered: 1 week ago