Re: [R] renumber a list of numbers

2013-01-07 Thread David Winsemius
On Jan 7, 2013, at 10:13 AM, David Winsemius wrote: On Jan 7, 2013, at 8:41 AM, Charles Determan Jr wrote: Greetings R users, I am trying to renumber my groups within the file shown below. The groups are currently set as 8,9,10,etc. I would like to renumber this as 1,2,3,etc. I have s

Re: [R] renumber a list of numbers

2013-01-07 Thread David Winsemius
On Jan 7, 2013, at 8:41 AM, Charles Determan Jr wrote: Greetings R users, I am trying to renumber my groups within the file shown below. The groups are currently set as 8,9,10,etc. I would like to renumber this as 1,2,3,etc. I have searched the help files and only come across using the

Re: [R] renumber a list of numbers

2013-01-07 Thread Rui Barradas
Hello, I'm not sure I understand. Do you want to renumber column Event_name starting at 1? If so the following does the job. dat$Event_name <- dat$Event_name - min(dat$Event_name) + 1 Hope this helps, Rui Barradas Em 07-01-2013 16:41, Charles Determan Jr escreveu: Greetings R users, I am

Re: [R] renumber a list of numbers

2013-01-07 Thread Sarah Goslee
Hi, It isn't entirely clear what you want, because it seems too simple. And most of your sample data are irrelevant, aren't they? Why not just use: testdata$Event_name2 <- testdata$Event_name - 7 Or you could try: testdata$Event_name3 <- as.numeric(as.factor(testdata$Event_name)) which will m

Re: [R] renumber a list of numbers

2013-01-07 Thread Charles Determan Jr
Thank you for your response, I didn't do the -7 because this is just a small part of the dataset and the number are not all consistent (ie skip some numbers occasionally). However, I did not think of the as.numeric(as.factor()) sequence. That did the trick, simple lapse in my thoughts that cost m

[R] renumber a list of numbers

2013-01-07 Thread Charles Determan Jr
Greetings R users, I am trying to renumber my groups within the file shown below. The groups are currently set as 8,9,10,etc. I would like to renumber this as 1,2,3,etc. I have searched the help files and only come across using the rownames to renumber the values but I need to match values. An