powered by
Change specified values to NA
specify_missing(x, ..., default_missing = c("", NA, "blanks"))
vector
values that should be changed to NA if found in x
NA
x
a vector with additional default values to change to NA. These are treated the same as ... but are added by default if not removed. A special value "blank" can be used to indicate all empty strings (all characters matching [:blank:], see regex).
...
"blank"
[:blank:]
x itself but with specified values set to NA.
# NOT RUN { x <- sample(100) x[sample(100, 10)] <- 999 specify_missing(x, 999) # }
Run the code above in your browser using DataLab