R Studio building table and graph.
Budget: $30 – $250 USD
The file brookvilleWeatherData.csv Download brookvilleWeatherData.csvcontains temperature records (in tenths of degrees C) for a weather station in nearby Brookville, Indiana from May 1925 through most of 2022. This data was obtained from the National Centers for Environmental Information (NCEI) within the National Oceanic and Atmospheric Administration (NOAA), You will be munging this data to build an aesthetically pleasing table and graphic.
Data Dictionary- variables and values
DATE: yyyymmdd format
Measure:
TMIN = daily observed LOW temperature (tenths of degrees C)
TTMAX = daily observed HIGH temperature (tenths of degrees C)
TOBS = daily observed temperature (tenths of degrees C), at specific time
Value: temperature in tenths of degrees C
Specific Tasks
Part 1 (30pts)
Using tidyverse functionality, wrangle the data in brookvilleWeatherData.csv Download brookvilleWeatherData.csvto construct a 12x5 table where:
first column is the reported Month (Jan, Feb, Mar, etc...),
second column is the average monthly low temperature (in degrees Fahrenheit) for all data recorded from January 1, 1930 through December 31, 2021,
third columns is the standard deviation of low temperatures from January 1, 1930 through December 31, 2021,
fourth column is the average monthly high temperature (Fahrenheit) for all data recorded from January 1, 1930 through December 31, 2021,
fifth column is the standard deviation of high temperatures from January 1, 1930 through December 31, 2021.
The table should be output in a knitted RMarkdown document in a well-formatted and easy to read form.
Part 2 (50pts)
For this part of the assignment you will perform some data wrangling to construct a multiple layered plot where the x-axis corresponds to the (Julian) day in a given year (January 1st, January 2nd, etc...) for all days excluding February 29th (thus 365 points along the x-axis). The plot will have a ribbon layer (see geom_ribbon) where the lower bound corresponds to the local linear regression prediction (LOESS smoother) of average daily minimum temperatures (in Fahrenheit) on that day for all days from 1930 through 2010 and the upper bound corresponds to the LOESS smoother of the average daily maximum temperature. Another layer will plot the average daily minimum and average daily maximum temperatures for all days from 2011 through 2021. An example of an unlabeled and (intentionally) ugly plot of this type can be found below. Your constructed plot must be properly labeled and annotated with well-chosen aesthetics to tell the story of what is being reported.
Ugly example plot to show form of what is being asked.
Submission (15pts)
Your submitted Markdown document will be saved in the same folder as the data and will knitted. It is expected that your document will knit without any edits (5 pts, all or nothing). The document should be well-formatted with appropriate annotations and comments, and clean of erroneous and unnecessary output (10pts).
Hints and Tips
For part 2, there are 32600 unique dates in that window after excluding February 29th.
Clean up your Table in Part 1 with kableExtra: https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.htmlLinks to an external site.
For the Local Linear Regression Smoother values
Use the built in function loess() -- it works just like lm() -- span=0.5 or 0.75 works well for this plot
You can use predict() on the fitted loess object to get the values for the plot
Data Dictionary- variables and values
DATE: yyyymmdd format
Measure:
TMIN = daily observed LOW temperature (tenths of degrees C)
TTMAX = daily observed HIGH temperature (tenths of degrees C)
TOBS = daily observed temperature (tenths of degrees C), at specific time
Value: temperature in tenths of degrees C
Specific Tasks
Part 1 (30pts)
Using tidyverse functionality, wrangle the data in brookvilleWeatherData.csv Download brookvilleWeatherData.csvto construct a 12x5 table where:
first column is the reported Month (Jan, Feb, Mar, etc...),
second column is the average monthly low temperature (in degrees Fahrenheit) for all data recorded from January 1, 1930 through December 31, 2021,
third columns is the standard deviation of low temperatures from January 1, 1930 through December 31, 2021,
fourth column is the average monthly high temperature (Fahrenheit) for all data recorded from January 1, 1930 through December 31, 2021,
fifth column is the standard deviation of high temperatures from January 1, 1930 through December 31, 2021.
The table should be output in a knitted RMarkdown document in a well-formatted and easy to read form.
Part 2 (50pts)
For this part of the assignment you will perform some data wrangling to construct a multiple layered plot where the x-axis corresponds to the (Julian) day in a given year (January 1st, January 2nd, etc...) for all days excluding February 29th (thus 365 points along the x-axis). The plot will have a ribbon layer (see geom_ribbon) where the lower bound corresponds to the local linear regression prediction (LOESS smoother) of average daily minimum temperatures (in Fahrenheit) on that day for all days from 1930 through 2010 and the upper bound corresponds to the LOESS smoother of the average daily maximum temperature. Another layer will plot the average daily minimum and average daily maximum temperatures for all days from 2011 through 2021. An example of an unlabeled and (intentionally) ugly plot of this type can be found below. Your constructed plot must be properly labeled and annotated with well-chosen aesthetics to tell the story of what is being reported.
Ugly example plot to show form of what is being asked.
Submission (15pts)
Your submitted Markdown document will be saved in the same folder as the data and will knitted. It is expected that your document will knit without any edits (5 pts, all or nothing). The document should be well-formatted with appropriate annotations and comments, and clean of erroneous and unnecessary output (10pts).
Hints and Tips
For part 2, there are 32600 unique dates in that window after excluding February 29th.
Clean up your Table in Part 1 with kableExtra: https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.htmlLinks to an external site.
For the Local Linear Regression Smoother values
Use the built in function loess() -- it works just like lm() -- span=0.5 or 0.75 works well for this plot
You can use predict() on the fitted loess object to get the values for the plot