-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsts_filter.Rd
45 lines (39 loc) · 1.22 KB
/
sts_filter.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
45
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sts_filter.R
\name{sts_filter}
\alias{sts_filter}
\title{General purpose data filtering for \emph{sts} time series objects}
\usage{
sts_filter(sts, ...)
}
\arguments{
\item{sts}{\emph{sts} object.}
\item{...}{Logical predicates defined in terms of the variables in
\code{sts$data}.}
}
\value{
A subset of the incoming \code{sts} time series object.
(A list with \code{meta} and \code{data} dataframes.)
}
\description{
A generalized data filter for \emph{sts} objects to
choose rows/cases where conditions are true. Multiple conditions are
combined with \code{&} or separated by a comma. Only rows where the condition
evaluates to TRUE are kept. Rows where the condition evaluates to \code{NA}
are dropped.
If an empty \emph{sts} object is passed in, it is immediately returned,
allowing for multiple filtering steps to be piped together and only checking
for an empty \emph{sts} object at the end of the pipeline.
}
\note{
Filtering is done on values in \code{sts$data}.
}
\examples{
library(MazamaTimeSeries)
unhealthy <- sts_filter(example_sts, pm25_A > 55.5, pm25_B > 55.5)
head(unhealthy$data)
}
\seealso{
\link{sts_filterDate}
\link{sts_filterDatetime}
}