I used to use ggpicrust2 but recently an error is being caused by a recent update to the ggplot2 package. what I did first is installing bioconductor envirment using this yml file (before the update of ggplot2 my script works and everything is ok
after that I runned this R script :
Load required libraries
the output of this script
As you can see, despite forcing the installation of ggplot2 version 3.4.4 in both my conda environment and R script, the final installation resulted in version 3.5.0. Upon investigation, I discovered that packages such as r-lmerTest==3.1_3, bioconductor-phyloseq==1.44.0, and r-plotly==4.10.3, among others, require ggplot2 version 3.5.0, leading to its installation instead of the specified version 3.4.4.
NB: I coudn't publish my R script so I did a screenshot
So what is your question? If you need ggplot2 == 3.4 then remove the dependencies that force it to upgrade. If you require the dependencies which rely on a newer version of ggplot2, then I think you are stuck with v3.5 to retain the functionality of the other packages. Also it looks like ggpicrust2 does have a newer version on CRAN so you could try upgrading that as well and it may resolve the error.
Your statement installing the specific version of ggplot2 if ggplot2 isn't installed will never run because it's already installed by conda via
r-tidyverse
.