Re: [R] grouping function

2012-05-08 Thread arun
0 0 0 3 0 0 0 0 > makegroup2(df$begin,df$end)  [1] 1 2 3 0 0 2 3 0 0 0 3 0 0 0 0 A. K. - Original Message - From: Sarah Goslee To: g...@asu.edu Cc: "r-help@r-project.org" Sent: Tuesday, May 8, 2012 2:33 PM Subject: Re: [R] grouping function Hi, On Tue, May 8, 2012 at 2:17 PM,

Re: [R] grouping function

2012-05-08 Thread Sarah Goslee
gt;> makegroup1(df$begin,df$end) >  [1] 3 3 3 0 0 3 3 0 0 0 3 0 0 0 0 >> makegroup2(df$begin,df$end) >  [1] 1 2 3 0 0 2 3 0 0 0 3 0 0 0 0 > > > A. K. > > > > > - Original Message - > From: Sarah Goslee > To: g...@asu.edu > Cc: "r-help@r-p

Re: [R] grouping function

2012-05-08 Thread Sarah Goslee
Hi, On Tue, May 8, 2012 at 2:17 PM, Geoffrey Smith wrote: > Hello, I would like to write a function that makes a grouping variable for > some panel data .  The grouping variable is made conditional on the begin > year and the end year.  Here is the code I have written so far. > > name <- c(rep('F

[R] grouping function

2012-05-08 Thread Geoffrey Smith
Hello, I would like to write a function that makes a grouping variable for some panel data . The grouping variable is made conditional on the begin year and the end year. Here is the code I have written so far. name <- c(rep('Frank',5), rep('Tony',5), rep('Edward',5)); begin <- c(seq(1990,1994),