View source: R/imputeUnivariate.R
imputeUnivariate | R Documentation |
Fills missing values of a vector, matrix or data frame by sampling with replacement from the non-missing values. For data frames, this sampling is done within column.
imputeUnivariate(x, v = NULL, seed = NULL)
x |
A vector, matrix or data frame. |
v |
A character vector of column names to impute (only relevant if |
seed |
An integer seed. |
x
with imputed values.
imputeUnivariate(c(NA, 0, 1, 0, 1))
imputeUnivariate(c("A", "A", NA))
imputeUnivariate(as.factor(c("A", "A", NA)))
head(imputeUnivariate(generateNA(iris)))
head(imputeUnivariate(generateNA(iris), v = "Species"))
head(imputeUnivariate(generateNA(iris), v = c("Species", "Petal.Length")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.