MatthieuStigler / matPkg

Other
2 stars 0 forks source link

new ggplot incompatibility #66

Open MatthieuStigler opened 6 months ago

MatthieuStigler commented 6 months ago

Error: could not find function "scales_add_defaults"

Happens also with:

library(matPkg)
library(ggplot2)
ggplot(mtcars, aes(wt, mpg)) + geom_point() +
  mat_gg_abline_01
#> Error in `ggplot2::geom_abline()`:
#> ! Problem while computing aesthetics.
#> ℹ Error occurred in the 2nd layer.
#> Caused by error in `scales_add_defaults()`:
#> ! could not find function "scales_add_defaults"

Created on 2024-03-11 with reprex v2.1.0

MatthieuStigler commented 6 months ago

code to replace:

mat_gg_abline_01 <- ggplot2::geom_abline(slope = 1, intercept = 0, linetype = 2)

atrenadoj commented 4 months ago

Hi!

I saw that you were able to fix the error Error in geom_pointrange(): ! Problem while computing aesthetics. Error occurred in the 1st layer. Caused by error in scales_add_defaults(): ! function scales_add_defaults could not be found.

I have a figure (fig_03) saved in my workspace and I can't replicate it again but I would like to make it functional

I would be very grateful if you could help me!

MatthieuStigler commented 4 months ago

Hi @atrenadoj

Are you using the functions wihtin the package, or asking a general gpglot2 question?

atrenadoj commented 4 months ago

Thanks for the quick reply,

I had a figure built and saved in my workspace, just trying to run it, with the new update to version 4.4. generates the error and does not load the figure. I do not know if it can be fixed without having to generate the figure again with ggplot2.

MatthieuStigler commented 4 months ago

I think you are asking a question related to ggplot2, then I suggest you to ask on a dedicated forum such as stack overflow. To ask there a good question, you might find this link useful: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

atrenadoj commented 4 months ago

Thank you very much

Netra27 commented 3 months ago

I am facing a similar issue. ! Problem while computing aesthetics. i Error occurred in the 1st layer. Caused by error in scales_add_defaults(): ! could not find function "scales_add_defaults" I would be grateful if someone can help me with this.

MatthieuStigler commented 3 months ago

Hi

please read above, this is not the right place to ask for it.

best luck