MixSIAR
MixSIAR copied to clipboard
"output_stats" function no longer works?
Hello! Following the vignette about modifying MixSIAR plots here, I've found that the "output_stats" function no longer works? This is the example from the vignette:
df.stats <- output_stats(jags.1, mix, source, output_options)
However, when I run this in R, I receive the following error: "could not find function "output_stats"
I just re-ran that vignette without problems. output_stats
is an exported function so should be there if you have loaded MixSIAR, eg library(MixSIAR)
.
I'm still having the same issue--when I run a model and then want to save the summary stats as a data frame, I get the same problem (and I have the MixSIAR package loaded):
jags.mod6habxses <- run_model(run="test", mix, source, discr, model_filename) df.stats <- output_stats(jags.mod6habxses, mix, source, output_options) Error in output_stats(jags.mod6habxses, mix, source, output_options) : could not find function "output_stats"
Does the vignette work? That is step one. I can't think of a reason for that error except the package not being loaded.
I confirmed that the vignette works on my machine.
On Tue, Aug 16, 2022, 5:43 PM Wieteke Holthuijzen @.***> wrote:
I'm still having the same issue--when I run a model and then want to save the summary stats as a data frame, I get the same problem (and I have the MixSIAR package loaded):
jags.mod6habxses <- run_model(run="test", mix, source, discr, model_filename) df.stats <- output_stats(jags.mod6habxses, mix, source, output_options) Error in output_stats(jags.mod6habxses, mix, source, output_options) : could not find function "output_stats"
— Reply to this email directly, view it on GitHub https://github.com/brianstock/MixSIAR/issues/318#issuecomment-1216815202, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHDA46RK2S72DJQPT4B5BDVZOZIPANCNFSM55WTIPNQ . You are receiving this because you commented.Message ID: @.***>
I just re-ran the Wolves vignette in reference to modifying MixSIAR plots (http://brianstock.github.io/MixSIAR/articles/modify_output.html), and I'm getting error messages for both the output_diagnostics and the output_stats functions:
diag <- output_diagnostics(jags.1, mix, source, output_options) Error in output_diagnostics(jags.1, mix, source, output_options) : could not find function "output_diagnostics" df.stats <- output_stats(jags.1, mix, source, output_options) Error in output_stats(jags.1, mix, source, output_options) : could not find function "output_stats"
The model ran and everything worked otherwise--it's just that these two functions do not seem to work on my machine for any of the vignettes or example data from MixSIAR. I've re-downloaded MixSIAR and all of its dependencies, loaded the MixSIAR package and ran the wolves script, but it's still not working for me. Any other thoughts? I've also updated R (R version 4.2.1 (2022-06-23 ucrt) -- "Funny-Looking Kid")
And you installed from Github instead of CRAN as in the vignette?
remotes::install_github("brianstock/MixSIAR", dependencies=T)
What do you get when you run:
> devtools::package_info("MixSIAR", dependencies=F)
package * version date (UTC) lib source
MixSIAR 3.1.12 2022-08-16 [1] Github (brianstock/MixSIAR@037978f)
Should say Github and the SHA should match the last commit, 037978f.
Yep, installed from Github. Here's what I get when I run the following code:
devtools::package_info("MixSIAR", dependencies=F) package * version date (UTC) lib source MixSIAR * 3.1.12 2022-08-16 [1] Github (brianstock/MixSIAR@037978f)
I'm sorry, I can't think of any reason those functions aren't in your MixSIAR install... since your R is up-to-date and you just re-installed from Github. Did you have a CRAN version of MixSIAR installed before? Have you tried uninstalling via remove.packages("MixSIAR")
and then doing remotes::install_github("brianstock/MixSIAR", dependencies=T)
?
The functions are here: https://github.com/brianstock/MixSIAR/blob/master/R/output_stats.R https://github.com/brianstock/MixSIAR/blob/master/R/output_diagnostics.R
Yes, I have uninstalled MixSIAR several times now, just to double-check, and then reinstalled via Github. I'm sorry that this is a problem, but thanks for trying to look into it! I've also ran those functions in R but doesn't seem to be working either.
I am also having this problem. I had to copy the functions from the webpage and save them as my own script in R. I then used source() to use them in RStudio. Seemed to work for me!
I am also having the same problem. says these commands don't exist.
Error in output_diagnostics(jags.mod[[mod]], mix[[mod]], source[[mod]], :
could not find function "output_diagnostics"