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

Use st_coordinates() to extract out coordinates #119

Merged
merged 2 commits into from
Jan 10, 2023

Conversation

DavisVaughan
Copy link
Contributor

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. Calling extract() on an sf tibble isn't particularly well defined, and it was already a little broken (it would return 2 geom columns by mistake somehow). We have now adjusted extract() 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 then mutate() 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!

@codecov-commenter
Copy link

Codecov Report

Base: 81.41% // Head: 81.44% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (035d8f7) compared to base (a897bef).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
+ Coverage   81.41%   81.44%   +0.02%     
==========================================
  Files          39       39              
  Lines        2497     2500       +3     
==========================================
+ Hits         2033     2036       +3     
  Misses        464      464              
Impacted Files Coverage Δ
R/calc_active_fire_properties.R 88.88% <100.00%> (+5.55%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@goergen95
Copy link
Member

Thanks for catching this. I will try to send an update on its way to CRAN in the next days. Just adding some more outstanding issues to the next release.

@goergen95 goergen95 merged commit e9e91b1 into mapme-initiative:main Jan 10, 2023
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.

3 participants