replace_na_with | R Documentation |
Replace NA values of a variable in a dataframe
replace_na_with(data, var_name, with)
data |
A dataframe |
var_name |
Name of variable where NAs are replaced |
with |
Value instead of NA |
Updated dataframe
data <- data.frame(nr = c(1,2,3,NA,NA))
replace_na_with(data, "nr", 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.