| percoutl | R Documentation |
Removes values above a top percentile and below a bottom percentile. Thresholds are computed from quantiles. Optionally, observation deletion based on consecutive missing values can be performed after outlier removal.
percoutl(data, cols = NULL, group = NULL, top = 0.995,
bottom = 0.0025, by = "min", half = 30,
date_col = NULL, cores = NULL, verbose = FALSE)
data |
A data frame or matrix. If a numeric vector is supplied, only outlier marking (no observation deletion) is performed because there is no time axis. |
cols |
Column indices or names of numeric variables. If
|
group |
Optional grouping column for group-wise outlier removal. |
top |
Top percentile threshold. Values above this quantile are removed. |
bottom |
Bottom percentile threshold. Values below this quantile are removed. |
by |
Time unit for observation deletion (see |
half |
Half window size, in minutes, for consecutive missing deletion. |
date_col |
Time column index or name. If |
cores |
Number of OpenMP threads. Passed to |
verbose |
Logical; if |
This method is a one-size-fits-all approach and may remove non-outliers
or fail to remove some outliers. It is provided for comparison with
condextr, which uses a point-by-point weighted
conditional extremum criterion.
A data frame with outliers removed.
Chun-Sheng Liang <chun-shengliang@qq.com>
1. Example data is from https://smear.avaa.csc.fi/download. It includes particle number concentrations in SMEAR I Varrio forest.
percoutl(obsedele(data[1:500, c(1, 4, 17:19)], cols = 3:5, group = 2),
cols = 3:5, group = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.