createDailyMeanComparePlot: Creates a daily half-hourly mean plot from the data.table...

View source: R/createDailyMeanComparePlot.R

createDailyMeanComparePlotR Documentation

Creates a daily half-hourly mean plot from the data.table given

Description

'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').

Usage

createDailyMeanComparePlot(
  dt,
  yVar,
  yCap,
  form = "step",
  yDiv = 1,
  lockDownStart,
  lockDownEnd,
  comparePlotCut = as.Date("2020-01-01"),
  toDate = lubridate::today()
)

Arguments

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()

Details

Adds a smoothed line using loess.

Author(s)

Ben Anderson, b.anderson@soton.ac.uk

See Also

Other plot: addLockdownRect(), createDailyPcComparePlot(), createRecentDateTimePlot(), createRecentHalfHourlyProfilePlot(), makeWeekdayPlot(), makeWeekdayTimePlot()


CfSOtago/gridCarbon documentation built on April 5, 2022, 6:46 a.m.