Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

major

Majority imputation for a vector


Description

This function is internally used by guess, it may be useless in reality.

Usage

major(x)

Arguments

x

a character (or numeric categorical) vector with missing values

Value

the same length of vector with missing values being imputed by the majority class in this vector.

Examples

a <- c(rep(0, 10), rep(1, 15), rep(2, 5))
a[sample(seq_along(a), 5)] <- NA
a
b <- major(a)
b

imputeR

A General Multivariate Imputation Framework

v2.2
GPL-3
Authors
Steffen Moritz [aut, cre] (<https://orcid.org/0000-0002-0085-1804>), Lingbing Feng [aut], Gen Nowak [ctb], Alan. H. Welsh [ctb], Terry. J. O'Neill [ctb]
Initial release
2020-01-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.