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

Non-orthogonal coords preserve AsIs x/y variables #6206

Merged
merged 6 commits into from
Nov 27, 2024

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6205.

Briefly in coord_sf(), coord_polar/radial(), the x/y variables are preserved if they both have the 'AsIs' type. I don't think there is a reasonable interpretation if just one of the variables is 'AsIs' and the other is a plain numeric.

@yutannihilation
Copy link
Member

Thanks for this fix. Generally looks good to me.

I don't think there is a reasonable interpretation if just one of the variables is 'AsIs' and the other is a plain numeric.

Should this be ignored with a warning rather than with no warning? Would it be annoying? Probably it's a rare case anyway, so I think either is fine.

@teunbrand
Copy link
Collaborator Author

Should this be ignored with a warning

It probably can't hurt to include it, so now it throws a warning like:

`coord_radial()` cannot respect the <AsIs> class of `x` when `y` is not also <AsIs>.

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!

@teunbrand
Copy link
Collaborator Author

Thank you for the review!

@teunbrand teunbrand merged commit 4193a50 into tidyverse:main Nov 27, 2024
13 checks passed
@teunbrand teunbrand deleted the coord_sf_asis_variables branch November 27, 2024 13:04
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.

'AsIs' position invalid when setting coord_sf: 'default_crs' parameter
2 participants