addLockdownRect: 'addLockdownRect' adds rectangles around the periods...

View source: R/addLockdownRect.R

addLockdownRectR Documentation

addLockdownRect adds rectangles around the periods specified as dates or date times on a plot where the x-axis is a date or datetime. Be sure to specify from & to as dates if the plot x-axis is a date and as dateTimes if it is a dateTime. Otherwise ggplot will throw a date_trans error.

Description

addLockdownRect adds rectangles around the periods specified as dates or date times on a plot where the x-axis is a date or datetime. Be sure to specify from & to as dates if the plot x-axis is a date and as dateTimes if it is a dateTime. Otherwise ggplot will throw a date_trans error.

Usage

addLockdownRect(
  p,
  from,
  to,
  label,
  yMin,
  yMax,
  alpha = 0.1,
  fill = "grey50",
  colour = "red"
)

Arguments

p

the plot to add them to

from

the start date/datetime

to

the end dat dat/datetime

label

the label to display

yMin

the smallest y value

yMax

the largest y value

alpha

- alpha value for the rect (0.1)

fill

- fill for the rect (grey50)

colour

- line colour for the rect (red)

Author(s)

Ben Anderson, b.anderson@soton.ac.uk (original)

See Also

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

Other utils: addSeason(), alignDates(), getDuration(), gzipFile(), loadLibraries(), nzCalculateCO2e(), setPeakPeriod(), setup(), tidyNum()


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