Skip to contents

impute missing values

Usage

impute(object, method)

# S3 method for class 'Metabolite'
impute(object, method = c("half-min", "median", "mean", "zero", "kNN"))

# Default S3 method
impute(object, method = "half-min")

# S3 method for class 'data.frame'
impute(object, method = c("half-min", "median", "mean", "zero", "kNN"))

impute_kNN(object)

Arguments

object

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

method

Imputation method, the default method is half the minimum value (`half-min`) of the metabolite. Currently support 'half-min', "median", "mean", "zero", "kNN".

Value

An object after imputing missing values.

Note

Wei, R., Wang, J., Su, M. et al. Missing Value Imputation Approach for Mass Spectrometry-based Metabolomics Data. Sci Rep 8, 663 (2018). https://doi.org/10.1038/s41598-017-19120-0

`impute_kNN`: Imputation using nearest neighbor averaging (kNN) method, the input is a Metabolite object, assayData was first transposed to row as metabolties and column as samples.

Examples

data(df_plasma)
d <- impute(df_plasma)