cafferychen777 / ggpicrust2

Make Picrust2 Output Analysis and Visualization Easier
https://cafferychen777.github.io/ggpicrust2/
Other
91 stars 11 forks source link

Error in `guide_transform()`: ! <Guide> classes have been rewritten as <ggproto> classes. #101

Open antonkratz opened 3 months ago

antonkratz commented 3 months ago

R version 4.3.1.

I cannot display the actual plots. It triggers an error:

Error in `guide_transform()`: ! <Guide> classes have been rewritten as <ggproto> classes.

Here is a minimal reproducible example:

> library(readr)
> library(ggpicrust2)
> library(tibble)
> library(tidyverse)
> library(ggprism)
> library(patchwork)

> data(metadata)

> data(metacyc_abundance)
> results_file_input <- ggpicrust2(data = metacyc_abundance,
                                 metadata = metadata,
                                 group = "Environment",
                                 pathway = "MetaCyc",
                                 daa_method = "LinDA",
                                 ko_to_kegg = FALSE,
                                 order = "group",
                                 p_values_bar = TRUE,
                                 x_lab = "description")

> results_file_input[[1]]$plot
Error in `guide_transform()`:
! <Guide> classes have been rewritten as <ggproto> classes.
The old S3 guide methods have been superseded.
Run `rlang::last_trace()` to see where the error occurred.
alasfar-lina commented 3 months ago

Same problem here

cafferychen777 commented 3 months ago

Hi @antonkratz and @alasfar-lina,

Thank you for bringing this to our attention. The issue you are experiencing with guide_transform() appears to be related to changes in the ggplot2 package version 3.5. As a temporary solution, I recommend downgrading ggplot2 to version 3.4.4 to see if that resolves the problem. You can do this by running the following command in R:

install.packages("ggplot2", version = "3.4.4")

Please let us know if this resolves the issue or if you have any further questions.

Best regards, Chen YANG

Steph0522 commented 3 months ago

This helped me out!