revalid(x = attitude[[1]], valid = 25:75, undefined = NA) # numeric vector
revalid(x = as.character(ToothGrowth[["supp"]]), valid = c('VC'),
undefined = NA) # character vector
revalid(x = ToothGrowth[["supp"]], valid = c('VC'),
undefined = NA) # factor
Run the code above in your browser using DataLab