imputeAll | R Documentation |
Impute missing values using random forest imputation.
imputeAll(d, occupancy = 2/3, parallel = "variables", seed = 1234)
## S4 method for signature 'AnalysisData'
imputeAll(d, occupancy = 2/3, parallel = "variables", seed = 1234)
imputeClass(d, cls = "class", occupancy = 2/3, seed = 1234)
## S4 method for signature 'AnalysisData'
imputeClass(d, cls = "class", occupancy = 2/3, seed = 1234)
d |
S4 object of class |
occupancy |
occupancy threshold above which missing values of a feature will be imputed |
parallel |
parallel type to use. See |
seed |
random number seed |
cls |
info column to use for class labels |
Missing values can have an important influence on downstream analyses with zero values heavily influencing the outcomes of parametric tests.
Where and how they are imputed are important considerations and is highly related to variable occupancy.
The methods provided here allow both these aspects to be taken into account and utilise random forest imputation using the missForest
package.
An S4 object of class AnalysisData
containing the data after imputation.
imputeAll
: Impute missing values across all sample features.
imputeClass
: Impute missing values class-wise.
## Each of the following examples shows the application of each imputation method and then
## a Linear Discriminant Analysis is plotted to show it's effect on the data structure.
## Initial example data preparation
library(metaboData)
d <- analysisData(abr1$neg[,200:250],abr1$fact) %>%
occupancyMaximum(occupancy = 2/3)
d %>%
plotLDA(cls = 'day')
## Missing value imputation across all samples
d %>%
imputeAll(parallel = 'no') %>%
plotLDA(cls = 'day')
## Missing value imputation class-wise
d %>%
imputeClass(cls = 'day') %>%
plotLDA(cls = 'day')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.