impute_na {lipidr} | R Documentation

## Impute missing values in a LipidomicsExperiment

### Description

Impute missing values in a LipidomicsExperiment

### Usage

    impute_na(
      data,
      measure = "Area",
      method = c("knn", "svd", "mle", "QRILC", "minDet", "minProb", "zero"),
      ...
    )

### Arguments

`data` | LipidomicsExperiment object.
`measure` | Which measure to use as intensity, usually Area, Area Normalized or Height. Default is `Area`.
`method` | The imputation method to use. All methods are wrappers for `imputeLCMD` package. These include knn Wraps `imputeLCMD::impute.wrapper.KNN()`. Default. This requires an additional argument `K` (Number of neighbors used to infer the missing data). svd Wraps `imputeLCMD::impute.wrapper.SVD()`. This requires an additional argument `K` (Number of principal components to use). mle Wraps `imputeLCMD::impute.wrapper.MLE()`, minDet Wraps `imputeLCMD::impute.MinDet()`, minProb Wraps `imputeLCMD::impute.MinProb()`, zero Wraps `imputeLCMD::impute.ZERO()`,
`...` | Other arguments passed to the imputation method.

### Value

LipidomicsExperiment object with missing values imputed.

### Examples

    data(data_normalized)

    # Replace with values calculated using K-nearest neighbors
    impute_na(data_normalized, "Area", "knn", 10)

    # Replace with values calculated from the first K principal components
    impute_na(data_normalized, "Area", "svd", 3)

    # Replace with Maximum likelihood estimates
    impute_na(data_normalized, "Area", "mle")

    # Replace with randomly drawn values from a truncated distribution
    impute_na(data_normalized, "Area", "QRILC")

    # Replace with a minimal value
    impute_na(data_normalized, "Area", "minDet")

    # Replace with randomly drawn values from a Gaussian distribution
    # cerntered around a minimal value
    impute_na(data_normalized, "Area", "minProb")

    # Replace with zero (not recommended)
    impute_na(data_normalized, "Area", "zero")

[Package lipidr version 2.6.0 Index]