-
Notifications
You must be signed in to change notification settings - Fork 293
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
dplyr::group_map() usage with sf data #969
Comments
For more context, |
tbh I'm going to need to see some demo code before
yes/no? |
Centroid was an example of an existing function. What I'm actually using is a custom function to find the nearest neighbor within each group and add the distance as a new column. Because this needs to create a unique value for each row in the group, I can't use summarize. In the past I might have split groups into a list, but this method seems better. |
Would be great if someone could report this works as expected!
|
Not sure if related, but I it seems I can't load
When I load them the other way round, |
You'll have to update dplyr to >= 0.8-0; since |
Thanks for the fast response! Having updated
|
I can confirm that the current master works, with the same results as @EhrmannS. Thanks! The "may not preserve their attributes" warning means that the CRS information has been lost. I am working around this by copying the CRS from another variable, e.g., |
First posted at tidyverse/dplyr#4143, they suggested I ask over here.
Using dplyr 0.8.0, using
group_map()
with sf objects is either failing or I'm using it wrong.Example below is using
st_centroid()
as a standin for a custom function I want to use that will keep all rows and create a new column of values, each value calculated for each row but only using the grouped rows.Thanks for any thoughts.
Created on 2019-01-31 by the reprex package (v0.2.1)
The text was updated successfully, but these errors were encountered: