Re: [R] calculation on series with different time-steps

2010-07-06 Thread Joris Meys
Look at ?ifelse en ?abs, eg : data_frame$new_column_in_dataframe - ifelse(stage$julian_day == baro$julian_day abs(stage$time - baro$hour) = 30, stage$stage.cm - baro$pressure, NA ) Cheers Joris On Thu, Jul 1, 2010 at 10:09 PM, Jeana Lee jeana@colorado.edu wrote: Hello, I have two

Re: [R] calculation on series with different time-steps

2010-07-05 Thread Jannis
Your question seem to me to be not precise enough for us to provide help. Do you need help with the if() syntax? If yes I would advice you to read some introductory R tutorial (like introduction to R (pdf, freely avalable on the net)) or some descent textbook. On quick hint for the correct

[R] calculation on series with different time-steps

2010-07-01 Thread Jeana Lee
Hello, I have two series, one with stream stage measurements every 5 minutes, and the other with barometric pressure measurements every hour. I want to subtract each barometric pressure measurement from the 12 stage measurements closest in time to it (6 stage measurements on either side of the