replace_missing_values {cleanepi} | R Documentation |
Replace missing values with NA
Description
Replace missing values with NA
Usage
replace_missing_values(
data,
target_columns = NULL,
na_strings = cleanepi::common_na_strings
)
Arguments
data |
A data frame or linelist |
target_columns |
A vector of column names. If provided, the substitution
of missing values will only be executed in those specified columns. When
the input data is a |
na_strings |
This is a vector of strings that represents the missing
values in the columns of interest. By default, it utilizes
|
Value
The input data where missing values are replaced by NA
.
Examples
cleaned_data <- replace_missing_values(
data = readRDS(system.file("extdata", "test_df.RDS",
package = "cleanepi")),
target_columns = "sex",
na_strings = "-99"
)
[Package cleanepi version 1.0.2 Index]