ft_impute | R Documentation |
Replaces NA
values in a factor vector using specified imputation methods.
ft_impute(factor_vec, method = "mode")
factor_vec |
A factor vector with potential |
method |
The imputation method: |
A factor vector with NA
values imputed.
Kai Guo
# Example factor vector with NAs
factor_vec <- factor(c('apple', NA, 'banana', 'apple', NA))
# Impute using mode
ft_impute(factor_vec, method = 'mode')
# Impute using random selection
ft_impute(factor_vec, method = 'random')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.