USGS-R / rloadest

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

Using selBestModel but want to tell loadest to use a specific model #8

Closed AllisonOliver closed 8 years ago

AllisonOliver commented 8 years ago

Hello. I am currently running rloadest with the "selBestModel" but I want to run loadest to use a model that it is not selecting. For example, it is picking "model 9" but I want to tell it to run "model 6" instead.

What is the best way to do this? Can I do it from "selBestModel" or should I be using a different function, such as "loadReg"? I haven't used loadReg yet so not totally sure how to build the specific model I am interested in.. I was hoping there was an easy way to just tell it to run the pre-existing model 6.

Here is the "selBestModel" code that I am currently using...

tmp.lr <- selBestModel("DOC", data = tmp.df, flow = "FLOW",dates = "datetime", conc.units="mg/L", station=this.station, load.units="kg", time.step="instantaneous", criterion=c("AICc"))

Any help is much appreciated! Thank you.

appling commented 8 years ago

Hi Allison, Yes, use loadReg.

tmp.lr <- selBestModel("DOC", data = tmp.df, flow = "FLOW",dates = "datetime", conc.units="mg/L", station=this.station, load.units="kg", time.step="instantaneous", criterion=c("AICc"))

tmp.lr <- loadReg(Phosphorus ~ model(6), data = tmp.df, flow = "FLOW",dates = "datetime", conc.units="mg/L", station=this.station, load.units="kg", time.step="instantaneous")
AllisonOliver commented 8 years ago

Hi Alison, Ah ha! I knew there must be a way to do it relatively straight forward... thank you!