lubridate_pacea_series: Convert an object that represents a time seris ('pacea_index'...

View source: R/lubridate-pacea-series.R

lubridate_pacea_seriesR Documentation

Convert an object that represents a time seris ('pacea_index' etc.) to have lubridate year/month column, and smooth over a year if required

Description

Called from 'plot.pacea_index()' and others to give a lubrdiate column for easier plotting.

Usage

lubridate_pacea_series(obj, smooth_over_year = FALSE)

Arguments

obj

a 'pacea_index' object, which is a time series.

smooth_over_year

logical to smooth monthly values over each calendar year (as per Tetjana Ross' plots, see '?oni' for reference). Note that the corresponding 'date' is for 1st January of each year.

Value

original object with month values smoothed (averaged) over the year if requested, and a new 'date' column in lubridate format. Sets a resulting date to be the first of the month or Jan 1st of that year (as appropriate), for easy plotting, but note that these should not be taken as exact dates, which is why we saved the original objects just as year and/or month, not lubridate dates.

Author(s)

Andrew Edwards

Examples

## Not run: 
lubridate_pacea_series(oni)
lubridate_pacea_series(oni, smooth_over_year=TRUE)


## End(Not run)

pbs-assess/PACea documentation built on April 17, 2025, 11:36 p.m.