[R] Interpolating a line and then summing there values for a diurnal oxygen curve (zoo object)

2008-07-27 Thread stephen sefick
#I would like to interpolate a straight line between 06/08/06 04:16:00 - 06/08/06 20:31:00 with values and then sum them. This is an estimate of ecosystem #respiration and I will be using this in a larger context(48 days of these diurnal curves), but for right now I am just trying to figure out

Re: [R] Interpolating a line and then summing there values for a diurnal oxygen curve (zoo object)

2008-07-27 Thread Gabor Grothendieck
Try this using your z and library(zoo): # extract section of interest w - window(z, start=chron(6/8/6, 4:16:0), end=chron(6/8/6, 20:31:0)) # zap all interior points with NA's and then fill back in using linear interpolation lin - na.approx(replace(w, time(w) start(w) time(w) end(w), NA)) #