Skip to content

geom_text() drops rows with angle = NA - #5162

Merged
teunbrand merged 4 commits into
tidyverse:mainfrom
teunbrand:drop_missing_angle
Jan 28, 2023
Merged

teunbrand merged 4 commits into
tidyverse:mainfrom
teunbrand:drop_missing_angle

Conversation

@teunbrand

Copy link
Copy Markdown
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

teunbrand commented Jan 26, 2023 •

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
Member

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

@teunbrand

Copy link
Copy Markdown
Collaborator Author

Thanks! That seems to have solved the issue.

@yutannihilation yutannihilation left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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