Re: [R] Assign the number to each group of multiple rows

2013-03-13 Thread Lilia Dmitrieva
2 3 > 77 1 3 1 > 88 1 3 2 > 99 2 4 1 > 10 10 2 4 2 > > > On Wed, Mar 13, 2013 at 3:05 PM, Lilia Dmitrieva wrote: > >> Dear R users, >> >> >> >> My data have repeating "beh" paramete

Re: [R] Assign the number to each group of multiple rows

2013-03-13 Thread Lilia Dmitrieva
#10 10 2 2 4 > A.K. > > > > > - Original Message - > From: Lilia Dmitrieva > To: r-help@r-project.org > Cc: > Sent: Wednesday, March 13, 2013 3:05 PM > Subject: [R] Assign the number to each group of multiple rows > > Dear R users, > > > &

[R] Assign the number to each group of multiple rows

2013-03-13 Thread Lilia Dmitrieva
Dear R users, My data have repeating "beh" parameter : 1 or 2 - type of animal behavior in subsequent locations. I need to assign unique number to each sequence of locations. My data is: >data=data.frame(row=seq(1:10),beh=c(1,1,1,2,2,2,1,1,2,2)) >attach(data) >data row beh 111