Displaying 1 result from an estimated 1 matches for "dppt".
Did you mean:
appt
2009 Mar 19
1
subtract values
...349
... ...
I would like to subtract the cumulative precipitation value at 01/01/2008 00:00 from the value at 01/02/2008 00:00 and so on. Thus, I would like to subtract cumPrecip at DateTime i from DateTime i+23, for each 24 hour period.
I tried using for loop:
dPpt=0
for (i in 1:length(Bk[,"cumPrecip"]))
{dPpt[i]=diff(Bk[i,(i+23),"cumPrecip"])}
dPpt=dPpt[seq(1,length(dPpt),24)]
But it had many errors. I also tried using diff(Bk$cumPrecip, lag=23) but this moves through the data one step at a time and thus calculates a value for every hou...