This function is a very simple function to impute a numeric or character vector with the mean or median value of the vector.
imputev(x, method="median",by=NULL)
Arguments
x: a numeric or character vector.
method: the method to choose between mean or median.
by: the level at which imputation will be done.
Returns
$x: a numeric or character vector imputed with the method selected.
References
Giovanny Covarrubias-Pazaran (2024). lme4breeding: enabling genetic evaluation in the age of genomic data. To be submitted to Bioinformatics.
Douglas Bates, Martin Maechler, Ben Bolker, Steve Walker (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1-48.