na_if_string | R Documentation |
In all character columns in data
any elements matching any of na_strings
are replaced with NA
.
na_if_string(data, na_strings = c(""))
data |
A data frame. |
na_strings |
Character vector of strings to convert to missing values. |
A modified version of data
with the same rows and columns.
df <- tibble::tibble(x1 = c("a", "", "1"),
x2 = c("-", "", "b"),
x3 = 1:3)
na_if_string(df, c("-", "", "1"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.