mts_trim {MazamaTimeSeries} | R Documentation |
Trim mts time series by removing missing values
Description
Trims the time range of an mts object by removing time steps from the start and end that contain only missing values.
Usage
mts_trim(mts = NULL)
Arguments
mts |
mts object. |
Value
A subset of the incoming mts time series object.
(A list with meta
and data
dataframes.)
Examples
library(MazamaTimeSeries)
# Untrimmed range
range(example_mts$data$datetime)
# Replace the first 50 data values for all non-"datetime" columns
example_mts$data[1:50, -1] <- NA
# Trimmed range
mts_trimmed <- mts_trim(example_mts)
range(mts_trimmed$data$datetime)
[Package MazamaTimeSeries version 0.3.0 Index]