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 |
The input |
target_columns |
A |
na_strings |
A |
Value
The input data where missing values are replaced by NA
.
Examples
data <- readRDS(
system.file("extdata", "test_df.RDS", package = "cleanepi")
)
# replace all occurrences of '-99' with NA
cleaned_data <- replace_missing_values(
data = data,
target_columns = NULL,
na_strings = "-99"
)
# print the names of the columns where the replacement occurred
print_report(cleaned_data, "missing_values_replaced_at")
[Package cleanepi version 1.1.1 Index]