Displaying 1 result from an estimated 1 matches for "sel_hr".
Did you mean:
seg_ar
2010 Jun 01
2
storing output data from a loop that has varying row numbers
...ata I'm working with now has a very varied number of rows
(0:2500) over a large data set and I can't work out how is best to do this.
So my loop would be:
for (i in 1:33){
SEL_DAY<-seal_dist[seal_dist[,10]==i,]
print(paste("DAY", i, "of 33"))
for (s in 1:11){
SEL_HR<-SEL_DAY[SEL_DAY[,5]==s,]
print(paste("HR", s, "of 11"))
indx <- subset(SEL_HR, SEL_HR$DIST == 0)
SEL_HR$TO_ID <- indx$ID[match(SEL_HR$TO, indx$TO)]}
}
where i is day and s is the hr within the day, the loop works fine because
it prints as i expect it too. I hav...