Replaces all occurrences of a specified value with another value within a data frame.

convert2(data, from = "", to = "")

Arguments

data

A data frame where value replacement will be performed.

from

Original value to be replaced.

to

New value that will replace the original value.

Value

A modified data frame with specified value replacements.

Examples

df <- data.frame(a = c(1, 2, 3), b = c("", "y", "z"))
convert2(df, from = "", to = NA)