replace_outlier: change outlier values as NA or winsorize

View source: R/generics.R

replace_outlierR Documentation

change outlier values as NA or winsorize

Description

change outlier values as NA or winsorize

Usage

replace_outlier(object, method, nSD)

## Default S3 method:
replace_outlier(object, method = "winsorize", nSD = 5)

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

## S3 method for class '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

data(df_plasma)
d <- replace_outlier(df_plasma, method = "winsorize", nSD = 5)


XikunHan/metabolomicsR documentation built on Oct. 14, 2024, 3:18 p.m.