[R] update index in for statement during calculation

2006-10-25 Thread Kim Milferstedt
Hello, I have a time series of data as a data.frame. Occasionally there is one or more days missing (e.g. data available for days 2, 3, 4, 8, 9, 10 -- missing days between 4 and 8). The experimental time information can be found in the 2nd column of data. I would like to have a continuous

Re: [R] update index in for statement during calculation

2006-10-25 Thread jim holtman
try using a 'while': i - 1 while (i nrow(data) - 1) { diff.time- round(data[i+1,2], 0) - round(data[i,2], 0)-1 old.row - nrow(data) if (diff.time 0) { fill- c(data[i,1], (round(data[i,2], 0)+1), rep(0,classnumber))

Re: [R] update index in

2006-10-25 Thread Mark Lyman
Kim Milferstedt milferst at uiuc.edu writes: Hello, I have a time series of data as a data.frame. Occasionally there is one or more days missing (e.g. data available for days 2, 3, 4, 8, 9, 10 -- missing days between 4 and 8). The experimental time information can be found in the 2nd