MixSIAR icon indicating copy to clipboard operation
MixSIAR copied to clipboard

"output_stats" function no longer works?

Open wholthuijzen opened this issue 2 years ago • 10 comments

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"

wholthuijzen avatar Aug 05 '22 16:08 wholthuijzen

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).

brianstock avatar Aug 10 '22 14:08 brianstock

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"

wholthuijzen avatar Aug 16 '22 15:08 wholthuijzen

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: @.***>

brianstock avatar Aug 16 '22 16:08 brianstock

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")

wholthuijzen avatar Aug 16 '22 17:08 wholthuijzen

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.

brianstock avatar Aug 16 '22 20:08 brianstock

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)

wholthuijzen avatar Aug 16 '22 20:08 wholthuijzen

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

brianstock avatar Aug 16 '22 20:08 brianstock

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.

wholthuijzen avatar Aug 16 '22 22:08 wholthuijzen

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!

KJames53 avatar Sep 05 '22 14:09 KJames53

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"

naalipalo avatar Jan 12 '23 23:01 naalipalo