bcgov / ssdtools

An R package to fit and plot Species Sensitivity Distributions (SSDs)
https://bcgov.github.io/ssdtools/
Apache License 2.0
30 stars 16 forks source link

Error in ssd_hc.fitdists: `...` must be unused. #282

Closed ScottCoffin closed 1 year ago

ScottCoffin commented 1 year ago

Issue

As of ssdtools version 1.0.0, the predict() function now returns the error: "Error in ssd_hc.fitdists: ... must be unused." whenever certain options are included (e.g., ic, average). Version 0.3.7 works perfectly with reprex below.

Reprex:

library(ssdtools) fits <- ssd_fit_dists(ssddata::ccme_boron) predict(fits, ci = TRUE, nboot = 10, ic = "aicc")

Returns: Error in predict.fitdists(): ! ... must be unused.

Note: I thought that this could be due to a change in the stats package from which the predict() function is from, however it still works in version 0.3.7. The ability to specify information criteria and model averaging is powerful, and I hope it is retained in the updated package.

joethorley commented 1 year ago

@ScottCoffin - thanks for reporting. Can you provide a reproducible example https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html

joethorley commented 1 year ago

The problem is that ic = "aicc" is no longer an argument as "aicc" is used by default.

To solve simply call

library(ssdtools)
fits <- ssd_fit_dists(ssddata::ccme_boron)
predict(fits, ci = TRUE, nboot = 10)