-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmts_select.Rd
52 lines (44 loc) · 1.34 KB
/
mts_select.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
46
47
48
49
50
51
52
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mts_select.R
\name{mts_select}
\alias{mts_select}
\title{Reorder and subset time series within an \emph{mts} time series object}
\usage{
mts_select(mts = NULL, deviceDeploymentID = NULL)
}
\arguments{
\item{mts}{\emph{mts} object.}
\item{deviceDeploymentID}{Vector of timeseries unique identifiers.}
}
\value{
A reordered (subset) of the incoming \emph{mts} time series object.
(A list with \code{meta} and \code{data} dataframes.)
}
\description{
This function acts similarly to \code{dplyr::select()} working on
\code{mts$data}. The returned \emph{mts} object will contain only those
time series identified by \code{deviceDeploymentID} in the order specified.
This can be used the specify a preferred order and is helpful when using
faceted plot functions based on
\href{https://ggplot2.tidyverse.org}{ggplot}
such as those found in the
\href{https://mazamascience.github.io/AirMonitorPlots/}{AirMonitorPlots} package.
}
\examples{
library(MazamaTimeSeries)
# Filter for "El Monte"
El_Monte <-
example_mts \%>\%
mts_filterMeta(communityRegion == "El Monte")
ids <- El_Monte$meta$deviceDeploymentID
rev_ids <- rev(ids)
print(ids)
print(rev_ids)
rev_El_Monte <-
example_mts \%>\%
mts_select(rev_ids)
print(rev_El_Monte$meta$deviceDeploymentID)
}
\seealso{
\link{mts_selectWhere}
}