Learn R Programming

metabolomicsR (version 1.0.0)

replace_outlier: change outlier values as NA or winsorize

Description

change outlier values as NA or winsorize

Usage

replace_outlier(object, method, nSD)

# S3 method for default replace_outlier(object, method = "winsorize", nSD = 5)

# S3 method for data.frame replace_outlier(object, method = "winsorize", nSD = 5)

# S3 method for Metabolite replace_outlier(object, method = "winsorize", nSD = 5)

Arguments

object

An object, a vector, data.frame, data.table or Metabolite.

method

Replace outlier value method, the default method is `winsorize`: replace the outlier values by the maximum and/or minimum values of the remaining values. `as_NA`: set as NA (do not use this method if using half-min imputation).

nSD

Define the N times of the SD as outliers.

Value

An object after replacing outlier values.

Examples

Run this code
# NOT RUN {
data(df_plasma)
d <- replace_outlier(df_plasma, method = "winsorize", nSD = 5)

# }

Run the code above in your browser using DataLab