adeverse / adegraphics

An S4 Lattice-Based Package for the Representation of Multivariate Data
https://adeverse.github.io/adegraphics/
9 stars 1 forks source link

Recent Breaking Changes in s.label? #15

Closed neellab-umd closed 10 months ago

neellab-umd commented 10 months ago

I have been working with the MEM vignette that includes several plots made with s.label. All of a sudden those plots are throwing errors. s.label was working as expected as of yesterday (12/19/2023) before I updated to the new version of RStudio ('Ocean Storm" SHA-256: 96A34972 Version: 2023.12.0+369 Released: 2023-12-15). I am using R version 4.3.2 (2023-10-31 ucrt) -- "Eye Holes" on Windows: x86_64-w64-mingw32/x64 (64-bit)

I get the issues using code from your s.label.R script in your test folder when I run R in the new RStudio.

x0 <- runif(50, -2, 2) y0 <- runif(50, -2, 2) z <- x0 ^ 2 + y0 ^ 2 dfxy1 <- data.frame(x0, y0) g1 <- s.label(dfxy1, label = as.character(z < 1), paxes.draw = TRUE, axis.text = list(col = "grey"))

Error in s.label(dfxy1, label = as.character(z < 1), paxes.draw = TRUE, : unused arguments (paxes.draw = TRUE, axis.text = list(col = "grey"))

But it runs as expected if I use R outside of RStudio. So it seems that changes in RStudio did something to break s.label.

thioulouse commented 10 months ago

Package adegraphics is not loaded. Trying again after using: library(ade4) library(adegraphics)

neellab-umd commented 10 months ago

I had both of those packages loaded. I checked again - twice - and still get the same error.

thioulouse commented 10 months ago

This is strange, I just checked with Rstudio Version 2023.12.0+369 (2023.12.0+369) and R version 4.3.2 (2023-10-31) -- "Eye Holes" and it works fine. Did you take care to load adegraphics AFTER ade4 ? If you load ade4 after adegraphics, then adregraphics graph functions are overwritten and you get the mentioned error.

neellab-umd commented 10 months ago

Thanks. The script that uses s.label loads ade4 before adegraphics so I have never seen this behavior and didn't find it via google searches. I must have loaded adegraphics in another script before loading ade4 and then adegraphics again in the offending script.

Sorry to bother you! I try my best to troubleshoot before submitting issues but did not see the source of this one.

thioulouse commented 10 months ago

No worries ! This is explained in the help page of functions library() and require() : Both functions check and update the list of currently attached packages and do not reload a namespace which is already loaded. So if you do successively: library(adegraphics) library(ade4) library(adegraphics) then you end up using ade4 graph functions instead of adegraphics ones, which may be confusing. One way around this (apart from starting a new R session) is to detach() the adegraphics package and then load it again: detach(package:adegraphics, unload = TRUE) library(adegraphics)