nums_to_NA {eHDPrep} | R Documentation |
Replaces specified numbers in numeric columns with NA
.
nums_to_NA(data, ..., nums_to_replace = NULL)
data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). |
... |
< |
nums_to_replace |
numeric vector of values to be replaced with
|
Columns to process can be specified in ...
or the function will be
applied to all numeric columns.
data
with specified values replaced with NA
data(example_data)
# replace all 1,2, and 3 from tumoursize and patient_id with NA.
nums_to_NA(data = example_data, tumoursize, patient_id, nums_to_replace = c(1,2,3))