Learn R Programming

specmine (version 1.0)

missingvalues_imputation: Missing values imputation

Description

Treats the missing values of a dataset according to a specific method.

Usage

missingvalues_imputation(dataset, method = "value", value = 5e-04, k = 5)

Arguments

dataset
list representing the dataset from a metabolomics experiment.
method
imputation method. It can be:
  • "value" - replaces the missing values with a specific value
  • "mean" - replaces the missing values with the mean of the variables' values
  • "median" - replaces the missing values with the median of the variables' values
  • "knn" - replaces the missing values with k nearest neighbor averaging
  • "linapprox" - replaces the missing values with linear approximation

value
the value to replace the missing values if the method is "value".
k
the number of neighbors if the method is "knn".

Value

Returns the dataset with no missing values.

Examples

Run this code
  ## Example of impute missing values
  data(propolis)
  dataset = missingvalues_imputation(propolis, method = "value", 
	    value = 0.0005)

Run the code above in your browser using DataLab