This function removes the first and/or last n records from each time-series. It works for both Raw and Agg formats.

mc_prep_trim(data, start = TRUE, end = FALSE, n = 1, logger_type = NULL)

Arguments

data

myClim object see myClim-package

start

logical; trim first n records (default TRUE)

end

logical; trim last n records (default FALSE)

n

number of records to trim from selected side(s); must be positive integer (default 1)

logger_type

optional filter; vector of logger types to trim in Raw-format (default NULL)

Value

myClim object in the same format as input, with trimmed time-series.

Details

In Raw-format, trimming can be restricted to selected logger types with logger_type. In Agg-format, logger_type is ignored.

If both start and end are TRUE, the function trims n records from both sides. When the resulting number of records is negative, the output time-series is empty.

Examples

data_trim <- mc_prep_trim(mc_data_example_clean, start=TRUE, end=TRUE,
                          n=1, logger_type=c("Thermo", "TMS"))