View source: R/recode_as_na_for.R
recode_as_na_for | R Documentation |
Recode Values as NA if they meet defined criteria
recode_as_na_for(df, criteria = "gt", value = 0, subset_cols = NULL)
df |
A data.frame object to manipulate |
criteria |
One of gt,gteq,lt,lteq to define greater than, greater than or equal to, less than or less than or equal to. |
value |
The value to convert to 'NA'. We can for instance change "n/a" to 'NA' or any other value. |
subset_cols |
An optional character vector for columns to manipulate. |
A data.frame object with the required changes.
recode_as_na_for(airquality,value=36, criteria = "gteq", subset_cols = c("Ozone","Solar.R"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.