R/makeRedundantVectorIndividualized.R

Defines functions makeRedundantVectorIndividualized

Documented in makeRedundantVectorIndividualized

#' Make a redundant vector individualized.
#' 
#' @param vec A vector. Can be a factor or character.
#' @return An individualized vector of character class
#' @author Alexander Kheirallah ([email protected])
#' @export

makeRedundantVectorIndividualized <- function(vec) {
  u <- as.character(vec)
  un <- unique(u)
  for(i in 1:length(un)){
    u[un[i] == u] <- makeUniqueCasesIndividualized(u[un[i] == u])
  }
  return(u)
}
msxakk89/dat documentation built on April 3, 2020, 5:39 p.m.