Pacific-salmon-assess / MetricsCOSEWIC

R Package for calculating COSEWIC metrics. Initial focus is on Probability of Decline.
GNU General Public License v3.0
0 stars 2 forks source link

indexing issue in README examples? #61

Closed DylanMG closed 2 years ago

DylanMG commented 2 years ago

When I run multiFit in both of the examples I get Error in out.mat["Jags_Med", "probdecl"] <- round(est.jags$probdecl, 5) : number of items to replace is not a multiple of replacement length and the function breaks.

Might have to do with indexing? I restarted R to double check and the issue persisted.

SOLV-Code commented 2 years ago

Welcome to the package! I think what you are running into is that we made some recent tweaks to the core package functions (with this merge) to accommodate requested features for the shiny app , and did not get around yet to update the wrapper functions like multiFit().

Specifically, the fn calcPercChangeMCMC now takes multiple BM values (-30,-50,-70) for the ProbDecl calculation, when it previously only took 1 value. The corresponding output object changed from a value to data frame, which breaks the summary as you found above.

Things are really hectic right now, so I wasn't planning to work on this package until early April. Are you using this actively right now, or just exploring the package?

You should also note that several other "under-the-hood" revisions have been identified for implementation over the next few month (e.g. STAN option). If you are planning to use this for a formal analysis in the near future, best to check with @carrieholt first.

carrieholt commented 2 years ago

Yes, later this year, we will be developing a STAN version of this code with more flexibility and exploration of the priors. Please get in touch by email if interested, and/or stay tuned for updates here. Also, thanks for catching this bug, which has cropped up from the revisions to the code for the Shiny App which takes multiple BM values (as mentioned above). Gottfried, thanks for agreeing to look at this in April. And thanks for your interest!

DylanMG commented 2 years ago

Thanks for the replies. I'm exploring the package. Looking forward to the updates. I'll keep watching and be in touch.

SOLV-Code commented 2 years ago

This is the same issue as #62, so closing this one