R/mice_imputation_pls_clean_missings.R

Defines functions mice_imputation_pls_clean_missings

## File Name: mice_imputation_pls_clean_missings.R
## File Version: 0.02


mice_imputation_pls_clean_missings <- function(x, eps=1e-12)
{
    csna <- colSums(is.na(x))
    ind_na <- which(csna>0)
    N <- nrow(x)
    L <- length(ind_na)
    if (L>0){
        x[,ind_na] <- matrix( stats::runif(N*L,-eps,eps), ncol=L)
    }
    return(x)
}

Try the miceadds package in your browser

Any scripts or data that you put into this service are public.

miceadds documentation built on May 29, 2024, 11:05 a.m.