Displaying 1 result from an estimated 1 matches for "tobereplac".
Did you mean:
tobereplaced
2008 Feb 29
3
Replace a list of values in data frame
...frame, such as in:
colorful
subject response
1 me black
2 me brown
3 you red
4 me black
5 you brown
read in with read.table()
I would like to replace both "black" and "brown" by
"dark".
What I have tried was:
ToBeReplaced=c("black","brown")
Replacement="dark"
test1<-replace(colorful,ToBeReplaced,Replacement)
which adds two columns:
test1
subject response black brown
1 me black dark dark
2 me brown dark dark
....
Replacing one value at a time as in:
test2<...