Use st_coordinates()
to extract out coordinates
#119
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
We ran revdeps for the upcoming release of tidyr 1.3.0 and your package came up.
It seems like you were using
tidyr::extract()
to pull the latitude and longitude out of a points column. Callingextract()
on an sf tibble isn't particularly well defined, and it was already a little broken (it would return 2geom
columns by mistake somehow). We have now adjustedextract()
to work a little better in this case, but it causes an error in your package.I think a more robust way to do what you are doing here is to use
st_coordinates()
which immediately gives you the longitude and latitude as a matrix which you can thenmutate()
on to your data frame.I am on a Mac so I can't fully test this (I get a lot of snapshot differences and see you have skipped a lot of tests on Mac), so please make sure it does what you intend.
We plan to release tidyr 1.3.0 on January 23rd.
This patch is backwards compatible with CRAN tidyr. If you could go ahead and release a version of your package to CRAN with this patch, then it would help us out a lot when we release tidyr. Thanks!