[R] apply switch to a table

2014-06-17 Thread Pooya Lalehzari
Hello, I have a simple Data table like below: Data V1 V2 1 1 3 2 5 4 And I like to apply a switch to all the values of the table. Exp for one value: switch(as.character(Data[2,1]), 1=One, 2=Two, 3=Three, 4=Four, 5=Five ) What would be the best way to do

Re: [R] apply switch to a table

2014-06-17 Thread Jeff Newmiller
That would depend on the actual type of object that your Data variable is. Use the dput function so we can get your example days in a reproducible way [1]. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Re: [R] apply switch to a table

2014-06-17 Thread David L Carlson
-help-boun...@r-project.org] On Behalf Of Pooya Lalehzari Sent: Tuesday, June 17, 2014 3:31 PM To: R help Subject: [R] apply switch to a table Hello, I have a simple Data table like below: Data V1 V2 1 1 3 2 5 4 And I like to apply a switch to all the values of the table. Exp for one value