daniel1noble / orchaRd

Extending the Orchard Plot for Meta-analysis
https://daniel1noble.github.io/orchaRd/
11 stars 6 forks source link

Pottier (2021) example bubble plot in vignette no longer reproducible #49

Closed befriendabacterium closed 9 months ago

befriendabacterium commented 10 months ago

Describe the bug The Pottier (2021) example bubble plot code doesn't seem to work anymore.

To Reproduce

Run the following code from https://daniel1noble.github.io/orchaRd/#example-5-bubble-plots-with-continuous-moderators or lines 556-572 in the source code at https://github.com/daniel1noble/orchaRd/blob/main/orchaRd_vignette.qmd

library(orchaRd)

# extract complete cases
data(pottier)
pottier2 <- pottier[complete.cases(pottier$body_mass), ]

# Model body mass effects
mod.body_mass <- metafor::rma.mv(yi = dARR, V = Var_dARR, mods = ~body_mass, method = "REML",
    test = "t", dfs = "contain", random = list(~1 | species_ID, ~1 | es_ID), data = pottier2)

orchaRd::bubble_plot(mod.body_mass, mod = "body_mass", group = "species_ID", xlab = "Body mass (g)",
    ylab = "Acclimation Response Ratio (ARR)", legend.pos = "top.left")

Throws error:

Error in `$<-.data.frame`(`*tmp*`, "condition", value = integer(0)) : 
  replacement has 0 rows, data has 494

Expected behavior Produces bubble plot shown in screenshot.

Screenshots Untitled

Desktop (please complete the following information):

befriendabacterium commented 10 months ago

Ok...some very weird behaviour to report with this one. So it throws the above bug if I am NOT in an RProject, but if I am in one - any one - it works?! Wahhhhhh. Can you reproduce this behaviour?

daniel1noble commented 10 months ago

@befriendabacterium Weird indeed. I am actually just running a bunch of examples and that one worked fine for me. I'm just working on #46 I'll see if I can reproduce it when I get a chance

daniel1noble commented 9 months ago

@befriendabacterium I can't seem to reproduce this behaviour, and I'm not working with .RProj (VSCode). So I'm not quite sure what might be happening there. I'll close this for now unless we can get a better gip on what's up.

befriendabacterium commented 9 months ago

Hm, even weirder. The behaviour is still reproducible for me, after a few days including a couple of computer restarts.

I should probably provide some extra info about my set-up:

R version: 4.3.1 RStudio version: 2023.06.1 Build 524 "Mountain Hydrangea"

Some info on RProject related options here.

image