format_caaqs_dt | R Documentation |
Intended for use with hourly air quality readings. Ensures that the date/times are in class POSIXct in the correct timezone, and ensures that the timestamp is associated with the previous hour as dictated in caaqs guidance manual.
format_caaqs_dt(
x,
format = "%Y-%m-%d %H:%M:%S",
prev_hour = TRUE,
tz = getOption("rcaaqs.timezone", default = "Etc/GMT+8")
)
x |
Vector of date-times as character or POSIXlt/ct. |
format |
The format of the character dates |
prev_hour |
Should the timestamp be assigned to the previous hour as
dictated by the CAAQS guidance document? Default |
tz |
The timezone of the date-times. See Details below. |
You can set the timezone that you are working with in two different
ways. You can set it globally with: options("rcaaqs.timezone" = "your_timezone")
or set it each time you call the function by setting the
tz
argument to "your_timezone" where "your_timezone" is a valid
timezone - see OlsonNames()
. The default (when
options("rcaaqs.timezone")
is unset) is "Etc/GMT+8"
, which is
equivalent to Pacific Standard Time, but does not use Daylight Savings
(i.e., is GMT+8 all year). This is the standard for Air Quality Monitoring
in British Columbia.
POSIXct vector
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.