replacedf: global replace of values from a data frame

Description Usage Arguments Value Note Examples

View source: R/datautilities.R

Description

global replace of values from a data frame

Usage

1
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

1
2
3
4
5
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 May 13, 2020, 3:31 a.m.