View source: R/monitor_mutate.R
monitor_mutate | R Documentation |
This function works similarly to dplyr::mutate()
and applies
FUN
to each time series found in monitor$data
. FUN
must
be a function that accepts a numeric vector as its first argument and returns
a vector of the same length.
monitor_mutate(monitor = NULL, FUN = NULL, ...)
monitor |
mts_monitor object. |
FUN |
Function used to modify time series. |
... |
Additional arguments to be passed to |
A modified mts_monitor
object. (A list with
meta
and data
dataframes.)
library(AirMonitor)
Carmel_Valley %>%
monitor_filterDatetime(2016080207, 2016080212) %>%
monitor_toCSV(includeMeta = FALSE) %>%
cat()
Carmel_Valley %>%
monitor_filterDatetime(2016080207, 2016080212) %>%
monitor_mutate(function(x) { return(x / 2) }) %>%
monitor_toCSV(includeMeta = FALSE) %>%
cat()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.