Question: In R create an S3 plot method for the class WeatherData that produces the following plots. Two plots must be on a single panel, one
In R create an S3 plot method for the class WeatherData that produces the following plots.
Two plots must be on a single panel, one above the other. Only the plot on the top panel will contain a main title. [0.3]
The plot on the top is about the daily Air Temperature (C). It must include the following:
- lines plot to show the daily air temperatures
- by default the plot will draw a red line for the maximum temperatures and a blue line for the minumum temperatures. The user must be able to change these colors
- the plot must include meaningful labels for the axis and legend
- the plot must include a grey vertical dotted line for each day to clearly identify the day corresponding to each couple of points. (hint: see the abline function)
- the plot by default should allow the user to identify clearly the noteworthy points by adding a point character over the value of the highest maximum temperature registered and a point character over the value of the lowest minimum temperature registered. The user must be able to decide to avoid to add the point characters to the plot.
The plot on the bottom is about the daily Precipitation Amount (mm). It must include the following:
- vertical-line plot to show the daily precipitation amount (hint: look at the help le of plot to see which type of plot you want to draw)
- by default the plot will draw the vertical bar for the day with the highest amount of rain in red. The user must be able to change the color to be used.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
