View source: R/Quality_checking.R
flag_periods | R Documentation |
Identify and flag values obtained during periods when measurements were not reliable (e.g. instrument maintenance based on field notes).
flag_periods(x, start, end, name_out = "-")
x |
A POSIXt vector providing timestamp of measurements. |
start , end |
A POSIXt vector marking the start and end of the periods to be flagged. They must be of the same length. |
name_out |
A character string providing |
Flagging is done according to the 0 - 2 quality control flag scheme.
An integer vector with the same length as x
. Its
varnames
and units
attributes are set to name_out
and
"-"
values, respectively.
# alternative style: as.POSIXct("2000-01-01 12:15:00", tz = "GMT")
timestamp <- seq(ISOdatetime(2000, 1, 1, 12, 15, 0, tz = "GMT"),
ISOdatetime(2000, 1, 1, 18, 15, 0, tz = "GMT"),
by = "30 mins")
periods <- data.frame(
start = c(ISOdatetime(2000, 1, 1, 13, 15, 0, tz = "GMT"),
ISOdatetime(2000, 1, 1, 16, 15, 0, tz = "GMT")),
end = c(ISOdatetime(2000, 1, 1, 14, 15, 0, tz = "GMT"),
ISOdatetime(2000, 1, 1, 17, 15, 0, tz = "GMT"))
)
(flags <- flag_periods(x, periods$start, periods$end, "qc_ALL_periods"))
data.frame(x, qc_ALL_periods = flags)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.