Description Usage Arguments Examples
Fix NA-like strings to be NA (or other value of choice)
1 | fix_na_ish(x, extra_na = NULL, new_val = NA)
|
x |
data frame |
extra_na |
Additional values to consider equivalent to NA |
new_val |
New value to be used instead of NA-ish values, default is |
1 2 3 4 5 6 7 8 | df <- data.frame(
a = c("NA", "n/a", 1, NA),
b = c("three", "na", NaN, " N/A "),
stringsAsFactors = FALSE
)
df
fix_na_ish(df)
fix_na_ish(df, extra_na = "three", new_val = "0")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.