Re: [R] Create an identifier variable

2011-11-29 Thread R. Michael Weylandt
Forgot the blog http://sas-and-r.blogspot.com/ M On Tue, Nov 29, 2011 at 5:51 PM, R. Michael Weylandt wrote: > Also, this blog has implementations of many common subroutines in both > SAS and R so you can learn "translations" between the two. > > Hope it helps, > > Michael > > On Tue, Nov 2

Re: [R] Create an identifier variable

2011-11-29 Thread R. Michael Weylandt
Also, this blog has implementations of many common subroutines in both SAS and R so you can learn "translations" between the two. Hope it helps, Michael On Tue, Nov 29, 2011 at 5:35 PM, R. Michael Weylandt wrote: > Try something like this: > > Suppose your data object is called df: > > cbind(pa

Re: [R] Create an identifier variable

2011-11-29 Thread R. Michael Weylandt
Try something like this: Suppose your data object is called df: cbind(paste("sd", 1:NROW(df), sep = ""), df) If you are just moving from SAS check out the website (and books associated with) http://r4stats.com -- it's got some tutorials on moving from other platforms to R. Michael On Tue, Nov

[R] Create an identifier variable

2011-11-29 Thread hyunjeehale
I am needing to create a new identifier variable for a data set which has no ID variable in the original file. I am basically wanting to take the count of each row and add "sd" in front of it - so it would look like so sd1 sd2 sd3 sd4 sd5 etc... I have no idea how to do this. I am a SAS user