View source: R/createDailyMeanComparePlot.R
createDailyMeanComparePlot | R Documentation |
'createDailyMeanComparePlot' returns a plot which calculates the mean of yVar and plots it for 2020 and 2017-2019 to compare the values for the same date over previous years. This assumes users pass in the aligned-date data ('dateFixed').
createDailyMeanComparePlot( dt, yVar, yCap, form = "step", yDiv = 1, lockDownStart, lockDownEnd, comparePlotCut = as.Date("2020-01-01"), toDate = lubridate::today() )
dt |
the data, assumed to be the aligned data (use alignDates() to do this) |
yVar |
the variable you want to plot |
yCap |
the caption for the y axis |
form |
do you want a "line" = geom_line() or a "step" = geom_step()? Step is the default |
yDiv |
the value you want to divide yVar by to make the y axis more sensible. Default = 1 |
lockDownStart |
date for start of lockdown rectangle annotation |
lockDownEnd |
date for end of lockdown rectangle annotation |
comparePlotCut |
start date to cut the plot (default 2020-01-01) |
toDate |
date to end the plot (usually the most recent observation), default = today() |
Adds a smoothed line using loess.
Ben Anderson, b.anderson@soton.ac.uk
Other plot:
addLockdownRect()
,
createDailyPcComparePlot()
,
createRecentDateTimePlot()
,
createRecentHalfHourlyProfilePlot()
,
makeWeekdayPlot()
,
makeWeekdayTimePlot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.