View source: R/remove_statistical_outlier.R
| remove_manually | R Documentation |
'remove_manually()' removes unreasonable values manually by indicating specific timestamps.
remove_manually(vctr_time, vctr_target, vctr_time_err, label_err = -9999)
vctr_time |
A timestamp vector of class POSIXct or POSIXlt. |
vctr_target |
A vector of a targeted time series to be checked. The length of the time series must be the same as that of 'vctr_time'. |
vctr_time_err |
A timestamp vector of class POSIXct or POSIXlt, indicating specific error timings. |
label_err |
A numeric value representing a missing value in the input vector(s). Default is -9999. |
A vector of cleaned time series. The length of the time series is the same as the input time series. The data points at the indicated time points by 'vctr_time_err' are replaced with the error label specified in 'label_err'.
Yoshiaki Hata
## Load data
data(dt_noisy)
time <- dt_noisy$time[12097:14400]
target <- dt_noisy$dt[12097:14400]
time_err <- seq(as.POSIXct("2013/06/27 18:00", tz = "Etc/GMT-8"),
as.POSIXct("2013/06/27 22:30", tz = "Etc/GMT-8"),
by = "30 min")
## Remove error values
result <-
remove_manually(vctr_time = time, vctr_target = target,
vctr_time_err = time_err)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.