Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-11-01 Thread Meredith, Christy S -FS
34 2946 2010 2.251 -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: Tuesday, October 30, 2012 1:57 PM To: Meredith, Christy S -FS Cc: R help; William Dunlap Subject: Re: [R] help with for loop: new column giving count of observation for each SITEID HI, You c

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Bert Gunter
Message - > From: William Dunlap > To: "Meredith, Christy S -FS" > Cc: "r-help@r-project.org" > Sent: Tuesday, October 30, 2012 3:43 PM > Subject: Re: [R] help with for loop: new column giving count of observation > for each SITEID > > Your data w

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread arun
; Cc: "r-help@r-project.org" Sent: Tuesday, October 30, 2012 3:43 PM Subject: Re: [R] help with for loop: new column giving count of observation for each SITEID Your data was, in R-readable format (from dput())   d <- data.frame(       RchID = 1:9,       site = factor(c(&qu

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Bert Gunter
C 1985 1 > 4D 1985 1 > 5C 2012 1 > 6A 2012 1 > 7B 2012 1 > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > >> -Original Message----- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun..

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread William Dunlap
Software wdunlap tibco.com > -Original Message----- > From: Meredith, Christy S -FS [mailto:csmered...@fs.fed.us] > Sent: Tuesday, October 30, 2012 12:20 PM > To: William Dunlap > Subject: RE: [R] help with for loop: new column giving count of observation > for each >

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Meredith, Christy S -FS
, Christy S -FS; r-help@R-project.org Subject: RE: [R] help with for loop: new column giving count of observation for each SITEID Is this what you want? > withinGroupIndex <- function(group, ...) ave(integer(length(group)), group, ..., FUN=seq_along) > site <- c("A",

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread William Dunlap
.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Meredith, Christy S -FS > Sent: Tuesday, October 30, 2012 11:17 AM > To: r-help@R-project.org > Subject: [R] help with for loop: new column giving count of observation for > each SITEID > > > Hello, > I think th

[R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Meredith, Christy S -FS
Hello, I think this is easy, but I can't seem to find a good way to do this in the R help. I have a list of sites, with multiple years of data for each site id. I want to create a new column that gives a number describing whether it is the 1st year ("1" ) the data was collected for the site, th