rchlumsk wrote:Hi Elizabeth
I believe you just need to pull the data from within the hydrograph object returned by hyd.read to pass it to the function. The error you get is recreated when a NULL object is passed to the function. Here is an example using the function from the sample data in RavenR, hopefully you can use that to help you with your own data.
Code: Select all
library(RavenR)
data(hydrograph.data) # sample dataset
myhyd <- hydrograph.data # same format as hyd.read function
# manually specify the sim and obs data, or use hyd.extract function
sim <- myhyd$hyd$Sub43
obs <- myhyd$hyd$Sub43_obs
# ?hyd.extract
# dd <- hyd.extract(subs="Sub43",myhyd)
annual.peak(sim,obs)
Cheers,
Rob
Good Morning Rob,
I tried the code you provided. It works with the data from RavenR for annual.peak(sim,obs). The function annual.peak(sim,obs) do work with my data as well. My post is not for annual.peak(sim,obs) but for the following functions:
annual.peak.event(sim,obs,add.r2=F)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied
annual.peak.event.error(sim,obs)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied
annual.peak.timing.error(sim,obs)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied
flowdurcurve.plot(myhyd$sim, prd='1999-10-01/2007-09-30',seasonal=F)
Error in as.POSIXlt.default(x, tz = tz(x)) :
do not know how to convert 'x' to class “POSIXlt”
I get the same error with the data from the RavenR as well as from my data.
Your help is highly appreciated.
Thank you
Elizabeth