USGS-R / rloadest

USGS water science R functions for LOAD ESTimation of constituents in rivers and streams.
Other
20 stars 19 forks source link

Error handling for duplicated days #2

Closed appling closed 9 years ago

appling commented 9 years ago

In line 192 of loadReg.R is this command:

stop("Duplicated days not permitted for time.step = \"day\"\n", Dys)

It would be nice to be able to fit a load model to resampled data in a bootstrap context, but this line makes that difficult and inelegant for daily data (i.e., the user has to lie about the time.step).

Would it be possible to change the stop() to a warning() so that such an analysis could proceed?

dlorenz-usgs commented 9 years ago

I am unwilling to change the error to a warning as it is impossible to have different mean flows and mean concentrations on the same day and that would be an error in coding. Also there are better ways to bootstrap regression models, so that should not be a problem. Davison and Hinkley are a great resource on bootstrapping. Dave

On Thu, Dec 11, 2014 at 12:57 PM, pangia notifications@github.com wrote:

In line 192 of loadReg.R is this command:

stop("Duplicated days not permitted for time.step = \"day\"\n", Dys)

It would be nice to be able to fit a load model to resampled data in a bootstrap context, but this line makes that difficult and inelegant for daily data (i.e., the user has to lie about the time.step).

Would it be possible to change the stop() to a warning() so that such an analysis could proceed?

— Reply to this email directly or view it on GitHub https://github.com/USGS-R/rloadest/issues/2.

appling commented 9 years ago

OK. Thanks for thinking about it.