Skip to content
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

geom_text() drops rows with angle = NA #5162

Merged
merged 4 commits into from
Jan 28, 2023

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #2757.

Briefly, it adds the angle to the non-missing aesthetics, causing the GeomText$handle_na() method to drop these observations with missing angles.

@teunbrand
Copy link
Collaborator Author

teunbrand commented Jan 26, 2023

Tests fail on R devel due to update to the graphics engine and its interaction with vdiffr/svglite.

From the R-devel/NEWS site:

Thu, 26 Jan 2023
CHANGES IN R-devel GRAPHICS
The graphics engine version, ‘R_GE_version’, has been bumped to ‘16’ and so packages that provide graphics devices should be reinstalled.

The ‘grDevices’ and ‘grid’ packages have new functions for rendering typeset glyphs, primarily: ‘grDevices::glyphInfo()’ and ‘grid::grid.glyph()’.

Rendering of typeset glyphs is only supported so far on the Cairo-based graphics devices and on the ‘pdf()’ device.

@yutannihilation
Copy link
Member

Good catch. Could you bump the cache-version to clear the packages compiled with an outdated version of R?

@teunbrand
Copy link
Collaborator Author

Thanks! That seems to have solved the issue.

Copy link
Member

@yutannihilation yutannihilation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! When I did a similar fix #3491 on geom_sf(), I accidentally broke some valid use cases, but I bet there's no such a downside in geom_text()'s case.

@teunbrand
Copy link
Collaborator Author

Thanks! I think we should be safe too; it would always throw an error and now it doesn't.

@teunbrand teunbrand merged commit 882584f into tidyverse:main Jan 28, 2023
@teunbrand teunbrand deleted the drop_missing_angle branch January 28, 2023 07:46
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.

geom_text throws error when angle = NA
2 participants