powered by
This function is internally used by guess, it may be useless in reality.
guess
major(x)
a character (or numeric categorical) vector with missing values
the same length of vector with missing values being imputed by the majority class in this vector.
# NOT RUN { a <- c(rep(0, 10), rep(1, 15), rep(2, 5)) a[sample(seq_along(a), 5)] <- NA a b <- major(a) b # }
Run the code above in your browser using DataLab