R/stripClass.R

Defines functions stripClass

Documented in stripClass

stripClass <- function(x, classString){
  classVec <- class(x)
  newClassVec <- classVec[classVec != classString]
  if(length(newClassVec) == 0) return(unclass(x))
  else {
    class(x) <- newClassVec
    return(x)
  }
}

Try the tis package in your browser

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

tis documentation built on Sept. 29, 2021, 1:06 a.m.