R/unfactor.R

Defines functions unfactor

Documented in unfactor

unfactor <-
function(x){
# unfactor() - convert vector x from factor to numeric
#              non numeric values will coerce to NA
  if(!is.factor(x)){
    stop("unfactor: argument x must be a factor:\n")
  }
  y <- as.numeric(as.character(x))
  return(y)
}

Try the dmm package in your browser

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

dmm documentation built on July 26, 2023, 5:23 p.m.