replacedf: global replace of values from a data frame

View source: R/datautilities.R

replacedfR Documentation

global replace of values from a data frame

Description

global replace of values from a data frame

Usage

replacedf(dat, from, to)

Arguments

dat

A data frame

from

value to replace

to

new value

Value

A dataframe

Note

All occurences of "from" or replaced with "to" even partial strings or individual numbers within a numeric value

Examples

data(iris)
newdat<-replacedf(iris, "setosa", "set")
newdat<-replacedf(iris, 1.2, 1.25)
df<-data.frame(a=c(-99, 1, 2, 3, -99), b=c(1, 2, 3, -99, 4))
replacedf(df, -99, NA)

wadetj/timsRstuff documentation built on April 24, 2023, 7:42 a.m.