View source: R/recode_as_na_if.R
recode_as_na_if | R Documentation |
Conditionally change all column values to NA
recode_as_na_if(df, sign = "gteq", percent_na = 50, keep_columns = NULL, ...)
df |
A data.frame object |
sign |
Character. One of gteq,lteq,lt,gt or eq which refer to greater than(gt) or equal(eq) or less than(lt) or equal to(eq) respectively. |
percent_na |
The percentage to use when dropping columns with missing values |
keep_columns |
Columns that should be kept despite meeting the target percent_na criterion(criteria) |
... |
Other arguments to "percent_missing" |
A 'data.frame' with the target columns populated with 'NA's.
head(recode_as_na_if(airquality, sign="gt", percent_na=20))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.