replace_values_in_dt {kim} | R Documentation |
Replace values in a data table
Description
Replace values in a data.table
Usage
replace_values_in_dt(
data = NULL,
old_values = NULL,
new_values = NULL,
silent = FALSE
)
Arguments
data |
a data object (a data frame or a data.table) |
old_values |
a vector of old values that need to be replaced |
new_values |
a new value or a vector of new values that will replace the old values |
silent |
If |
Examples
replace_values_in_dt(data = mtcars, old_values = 21.0, new_values = 888)
replace_values_in_dt(data = mtcars, old_values = c(0, 1), new_values = 999)
replace_values_in_dt(
data = mtcars, old_values = c(0, 1), new_values = 990:991)
replace_values_in_dt(
data = data.table::data.table(a = NA_character_, b = NA_character_),
old_values = NA, new_values = "")
[Package kim version 0.5.422 Index]