View source: R/datautilities.R
replacedf | R Documentation |
global replace of values from a data frame
replacedf(dat, from, to)
dat |
A data frame |
from |
value to replace |
to |
new value |
A dataframe
All occurences of "from" or replaced with "to" even partial strings or individual numbers within a numeric value
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.