-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
join_mutate(x = <sf>) #4917
Comments
A number of packages exhibit that issue as part of the latest revdep checks:
I'm not sure all these are related to |
This comment has been minimized.
This comment has been minimized.
The |
This comment has been minimized.
This comment has been minimized.
@edzer — I wanted to alert you to this issue. The basic problem is that sf breaks an implicit contract that we expect data.frame subclasses to fulfil. It's not totally clear to me what we need to do fix it — sf is an important class so we could change dplyr to make it work (or at least figure out how to make this bit of code generic). But I wanted to check with you that you were committed to this behaviour before we did a significant amount of work. |
One potential compromise would be to allow 1-parameter The sf data frame could devolve either into a partially instantiated state (waiting for a geometry column to be added back later on), or to a bare data frame. |
Thanks for notifying me! @lionel- on the What I now did is strip the |
@edzer are you happy to continue with that approach? It sounds like you'll now need to add methods for all the join functions. |
Thanks @hadley - let's put it this way: I would be the last person who'd be unhappy if
|
@edzer you can consider this informal notification 😄 — we'll be sending out the formal revdep emails later in the week. We now have a somewhat more principled approach described in |
This is going to hit all users now using
is not helpful and I've already experienced several users then seeking help with the |
Ah, I didn't think about the |
This ensures that we always know what methods are being called, and predicts us against variations in subclass implementations. The main downside of this approach is that we can no longer translate grouping variable names in the presence of ambiguity Fixes #4917
This ensures that we always know what methods are being called, predicts us against variations in subclass implementations, and avoid dev vctrs group re-computation. The main downside of this approach is that we can no longer translate grouping variable names in the presence of ambiguity Fixes #4917
Ok, I'm pretty happy with the current fix — we'll need to keep thinking about what the optimal behaviour is here, but at least sf objects work once more. |
Great, thanks a lot!! |
Created on 2020-03-02 by the reprex package (v0.3.0.9000)
This happens here: https://github.com/tidyverse/dplyr/blob/master/R/join.r#L296
because
x
is ansf
object and the[
method brings back thegeometry
column, sox[vars$x$key]
does not have the same number of columns as the length ofnames(vars$x$key)
The text was updated successfully, but these errors were encountered: