R/prepare_factor.R

Defines functions prepare_factor

prepare_factor <- function(fac, effmod, notmod, name_x){
  
  if(is.null(effmod)){
    effmod <- name_x[-fac]
  } else{
    if(name_x[fac]%in%effmod){
      effmod <- effmod[!which(effmod==name_x[fac])]
    }
  }
  
  if(is.null(notmod)){
    notmod <- list() 
  }
  
  for(i in name_x[-fac]){
    notmod[[length(notmod)+1]] <- c(name_x[fac],i)
  }
 
  return(list(effmod, notmod)) 
}

Try the TSVC package in your browser

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

TSVC documentation built on Oct. 17, 2023, 5:12 p.m.