Skip to content

Conversation

@kassambara
Copy link
Owner

Summary

  • Fix theme validation errors with ggplot2 development version by removing manual class assignment in theme_survminer()
  • Fix test suite layer access syntax to support both stable and development ggplot2 versions
  • Add utility function for ggplot2 version comparison

Changes

  • R/ggsurvtheme.R: Remove class(result) <- "theme" to use proper ggplot2 theme construction
  • tests/testthat/test-ggsurvplot_facet.R: Update layer access to use @layers for ggplot2 > 3.5.2, $layers for older versions
  • R/utilities.R: Add is_pkg_version_sup() utility for version checking
  • NEWS.md: Document compatibility fixes

Test Results

All tests pass with ggplot2 development version. Theme validation warnings eliminated.

Closes #681

Remove manual class assignment in theme_survminer() to ensure proper
theme object construction compatible with ggplot2 development version.
Update test to use @layers syntax for ggplot2 > 3.5.2, maintaining
backward compatibility with $layers for older versions.
Document ggplot2 compatibility fixes and add version comparison utility.
@kassambara kassambara merged commit 48587a8 into master Sep 2, 2025
0 of 5 checks passed
@kassambara kassambara deleted the fix-681-test-suite branch September 2, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test Suite Failures with Development Version of ggplot2

2 participants