Giter VIP home page Giter VIP logo

Comments (3)

jhoviatt avatar jhoviatt commented on September 16, 2024

I also get this error. Running OSX Monterey with an M1.

> output_JAGS(jags.1, mix, source)
Error in UseMethod("depth") : 
  no applicable method for 'depth' applied to an object of class "NULL"
In addition: Warning messages:
1: In par(usr) : argument 1 does not name a graphical parameter
2: In par(usr) : argument 1 does not name a graphical parameter
3: In par(usr) : argument 1 does not name a graphical parameter
4: In par(usr) : argument 1 does not name a graphical parameter
5: In par(usr) : argument 1 does not name a graphical parameter
6: In par(usr) : argument 1 does not name a graphical parameter
7: In par(usr) : argument 1 does not name a graphical parameter
8: In par(usr) : argument 1 does not name a graphical parameter
9: In par(usr) : argument 1 does not name a graphical parameter
10: In par(usr) : argument 1 does not name a graphical parameter

I'm using a fresh updated install of R (4.2.2). I installed all packages (except GTK packages) from here.

I get the error running the vignettes using

library(MixSIAR)
mixsiar.dir <- find.package("MixSIAR")
file.path(mixsiar.dir, "example_scripts")

source(file.path(mixsiar.dir, "example_scripts", "mixsiar_script_wolves.R"))

traceback() produces

17: depth(path)
16: upViewport(depth(vp), recording = FALSE)
15: popgrobvp.viewport(x$vp)
14: popgrobvp(x$vp)
13: postDraw.grob(x)
12: postDraw(x)
11: drawGTree(x)
10: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
9: grid.draw.gTree(x$children[[i]], recording = FALSE)
8: grid.draw(x$children[[i]], recording = FALSE)
7: drawGTree(x)
6: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
5: grid.draw.gTree(gtable)
4: grid.draw(gtable)
3: print.ggplot(ggplot2::ggplot(df, ggplot2::aes(x = x, fill = sources, 
       colour = sources)) + ggplot2::geom_density(alpha = 0.3, ggplot2::aes(y = ..scaled..)) + 
       ggplot2::xlim(0, 1) + ggplot2::theme_bw() + ggplot2::xlab("Proportion of Diet") + 
       ggplot2::ylab("Scaled Posterior Density") + ggplot2::labs(title = my.title) + 
       ggplot2::theme(legend.position = c(1, 1), legend.justification = c(1, 
           1), legend.title = ggplot2::element_blank()))
2: print(ggplot2::ggplot(df, ggplot2::aes(x = x, fill = sources, 
       colour = sources)) + ggplot2::geom_density(alpha = 0.3, ggplot2::aes(y = ..scaled..)) + 
       ggplot2::xlim(0, 1) + ggplot2::theme_bw() + ggplot2::xlab("Proportion of Diet") + 
       ggplot2::ylab("Scaled Posterior Density") + ggplot2::labs(title = my.title) + 
       ggplot2::theme(legend.position = c(1, 1), legend.justification = c(1, 
           1), legend.title = ggplot2::element_blank()))
1: output_JAGS(jags.1, mix, source)

Possibly somewhere around line 292 in output_JAGS.r

EDIT:

Reinstalling using remotes::install_github("brianstock/MixSIAR", dependencies=T) seems to have eliminated the error. There are still lots of warnings related to ggplot2::aes(y = ..scaled..) but it ran.

EDIT 2:

After more exploration, the error now appears for the 'killer whale' vignette but not wolves or geese. as above, there are still plenty of warnings related to ggplot.

EDIT 3:

Apparently, it's not related to a specific vignette since it's happening randomly. Seems like it might be related to this old tidyverse issue.

from mixsiar.

choy-tech avatar choy-tech commented on September 16, 2024

Hello, I have same problem with OSX Ventura and I upgrade Mac OS and I run the MixSIAR but I have same error like you mentioned above.Traceback() produce same. I remove all Rstudio and Xquarz and reseal all again but there is still problem.
Do you know any solution on this error. if you have any idea, it will be very helpful.

from mixsiar.

DSchimmenti avatar DSchimmenti commented on September 16, 2024

I'm also running on MacOS and having this issue in RStudio and base R even after reinstalling the package per @jhoviatt 's suggestions. I noticed this error occurs when running any of the vignettes or my own data with any fixed or random effects. When I remove fixed/random effects for my data or run the "killer whale" vignette, for example, which has no fixed or random effects output_JAGS() works with no errors. What's frustrating, as noted by others, is that the error appears to be related to the ggplot objects, but it is preventing output of the summary statistics and diagnostics (for me at least) of the model...

from mixsiar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.