-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflag_periods.Rd
44 lines (41 loc) · 1.5 KB
/
flag_periods.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Quality_checking.R
\name{flag_periods}
\alias{flag_periods}
\title{Flag Affected Periods}
\usage{
flag_periods(x, start, end, name_out = "-")
}
\arguments{
\item{x}{A POSIXt vector providing timestamp of measurements.}
\item{start, end}{A POSIXt vector marking the start and end of the periods to
be flagged. They must be of the same length.}
\item{name_out}{A character string providing \code{varnames} attribute value
of the output.}
}
\value{
An integer vector with the same length as \code{x}. Its
\code{varnames} and \code{units} attributes are set to \code{name_out} and
\code{"-"} values, respectively.
}
\description{
Identify and flag values obtained during periods when measurements were not
reliable (e.g. instrument maintenance based on field notes).
}
\details{
Flagging is done according to the 0 - 2 quality control flag scheme.
}
\examples{
# 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)
}