Displaying 1 result from an estimated 1 matches for "indexg".
Did you mean:
index
2012 Oct 30
2
help with for loop: new column giving count of observation for each SITEID
...llected for the site, the second year ("2"), etc. I have different years for each siteid, but I don't care which year it was collected, just the order that it is in for that siteid. This is what I have so far, but it doesn't do the analysis separately for each SiteID.
indexi<-indexg[order(indexg$SiteID,indexg$Yr),]
obs=0
indexi=na.omit(indexi)
for(i in 1:length(indexi$SiteID)){
obs=obs+1
indexi$obs[i]=obs
}
Thanks for any help you can give.
Christy Meredith
USDA Forest Service
Rocky Mountain Research Station
PIBO Monitoring
Data Analyst
Voice: 435-755-3573
Fax: 435-755-356...