Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Using function data() to load R data set airquality . Provide the simplest R code and output for all of the following. The code should

Using function data() to load R data set airquality.

Provide the simplest R code and output for all of the following. The code should work for any given data.

a)Use the diff function to calculate the temperature differences between consecutive days.

Insert the value 0 at the beginning of these differences. Add this result as the DIFFS column of the data frame.

b)Calculate the number of days that are warmer than the previous day?

c)Show the mean and median temperature for each month (May to Sept.). Do not hard code the month. Print out your result properly. For example, "The average and median temperature for May are xxx and xxx; ...".

d) Show the coldest and hottest day in each month (May to Sept.). Do not hard code the month. Print out your result properly. For example, "The coldest and hottest days in May are xxx and xxx; ...".

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

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

Financial Accounting

Authors: Charles T. Horngren, Jr. Harrison, Walter T.

2nd Edition

0133118207, 978-0133118209

Students also viewed these Mathematics questions