R/factmem.R

Defines functions factmem

#' @title factmem
#' @description memorizes factors' levels
#' @return list
#' @author E. F. Haghish
#' @keywords Internal
#' @noRd
factmem <- function(df) {
  mem <- list()
  for (i in 1:ncol(df)) {
    lev <- levels(df[,i])
    len <- 1:length(lev)
    nam <- colnames(df)[i]
    mem[[i]] <- list(names = nam, length = len, level=lev)
  }

  return(mem)
}

Try the mlim package in your browser

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

mlim documentation built on Dec. 28, 2022, 2:33 a.m.