R/toNA.R

toNA<-function(x,values=NA) {
 if(missing(x)) 
  stop("Usage: toNA(x,values=NA)\n\twhere value is one or more values to be set to NA")
 x[x %in% values] <- NA
 return(x)
}

Try the prettyR package in your browser

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

prettyR documentation built on May 2, 2019, 2:16 a.m.