-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRAN check failing due to ggplot2 errors (only on Windows devel) #5702
Comments
Hi Sam, Yesterday we submitted a new version of ggplot2 3.5.0 to CRAN, however, the submission is at the time of writing, not yet released. The scCustomize package has been on our radar for reverse dependency failures. When analysing these, we thought the problems originated from the ggprism package. We have submitted a fix to ggprism, see csdaw/ggprism#25, but this has not been merged and released at this point. The issue at hand is that If you want to address this at the scCustomize side of things (which ideally shouldn't have to be the case), I'm going to recommend you to explicitly remove the A reprex with the release candidate: library(scCustomize)
#> Loading required package: Seurat
#> Loading required package: SeuratObject
#> Loading required package: sp
#>
#> Attaching package: 'SeuratObject'
#> The following object is masked from 'package:base':
#>
#> intersect
#> scCustomize v2.0.1
#> If you find the scCustomize useful please cite.
#> See 'samuel-marsh.github.io/scCustomize/articles/FAQ.html' for citation info.
library(Seurat)
pbmc_small$sample_id <- sample(c("sample1", "sample2"), size = ncol(pbmc_small), replace = TRUE)
# Plot
p <- Plot_Median_Genes(
seurat_object = pbmc_small,
sample_col = "orig.ident",
group_by = "sample_id"
)
# Does not work
p
#> Bin width defaults to 1/30 of the range of the data. Pick better value with
#> `binwidth`.
#> Error in `plot_theme()` at ggplot2/R/plot-build.R:178:3:
#> ! The `legend.text.align` theme element is not defined in the element
#> hierarchy.
# At least renders without error. I'm not sure about the correctness of the plot.
p$theme[c("legend.text.align", "legend.title.align")] <- NULL
p
#> Bin width defaults to 1/30 of the range of the data. Pick better value with
#> `binwidth`. Created on 2024-02-22 with reprex v2.1.0 If you want to test yourself and see if the solution works, you can install the release candidate as follows: remotes::install_github("tidyverse/ggplot2", ref = remotes::github_pull("5592")) I hope this answers most of your questions, and if you have more we'll be glad to hear them. Best, |
Hi Tuen, Thank you so much for quick reply and explanation!! That totally makes sense now given the deprecation and how the theme is created in ggprism. I'm going to go ahead and make temp fix in scCustomize so that I can push my newest version to CRAN and I'll add quick ping on the ggprism PR and hopefully it can be addressed soon. Thanks so much again! |
Hi @teunbrand, So while waiting for fix from ggprism I decide to try just specifying ggplot2 version in DESCRIPTION to avoid 3.5.0 related errors. When I use either
or
I double checked and it doesn't appear that any of the other packages that I specify version numbers for in my DESCRIPTION conflict with those in ggplot2 rc/3.5.0 branch so unsure what issue is. If you have any thoughts or advice I would greatly appreciate it! Thanks again!! |
Hi Sam, IIRC you can only specify a minimum version of a package, not a maximum. Best, |
Hi Teun, Yes you're right! I was implementing wrong in my test code but that indeed works. Thanks so much again for the help and quick replies!!!! Best, |
Hi ggplot2 team,
I'm author and maintainer of CRAN package scCustomize. Starting yesterday (feb-21) I'm getting ggplot2 related errors when running
devtools::check_win_devel()
but did not receive same error when running on Friday Feb-16. The errors are coming from a function that I have never had issue with before and my debugging attempts have left me a little stumped.The functions in question related to use of a custom ggplot2 theme. See here for full plotting code in function context plotting elements are as follows:
The error (that again was not present when running checks last week) is:
Error 1
The theme
theme_ggprism_mod
is extension of this theme from CRAN package ggprism (which does definelegend.text.align
)My function extending this theme can be found here and the code is:
To debug things as this error does not occur on testing with any other platform I simply added
dontrun
to the examples and ran check again.The identical error came back testing the example code of the theme extension in my package
theme_ggprism_mod
To debug further I removed
dontrun
and swapped out my modified theme for the original theme from ggprism:However, I still get the same error.
So at this point I'm a bit stumped because it seems my theme modification is fine and the plotting functions, theme modification, and ggprism have all been through multiple previous CRAN releases without issue.
Also as I mentioned these errors were not present in checks run on Feb 16th. Is this potentially just an issue of instability in the Windows R dev build? Since the errors were coming from ggplot2 that seemed unlikely to me but maybe you have more insight.
Hoping you might be able to provide some insight.
Thanks in advance!!
Sam
The text was updated successfully, but these errors were encountered: