rmaia / pavo

tools for the analysis of color data in R
http://pavo.colrverse.com
GNU General Public License v2.0
69 stars 17 forks source link

replace sp point.in.polygon before October #252

Closed thomased closed 1 year ago

thomased commented 1 year ago

library(pavo)

The legacy packages maptools, rgdal, and rgeos, underpinning the sp package, which was just loaded, will retire in October 2023. Please refer to R-spatial evolution reports for details, especially https://r-spatial.org/r/2023/05/15/evolution4.html. It may be desirable to make the sf package available; package maintainers should consider adding sf to Suggests:. The sp package is now running under evolution status 2 (status 2 uses the sf package in place of rgdal)

Only used here

https://github.com/rmaia/pavo/blob/347865f97ef7068211c29fb877799c4987830ac4/R/adjacent.R#L654

Bisaloo commented 1 year ago

One low dependency alternative could be https://r-spatial.github.io/s2/reference/s2_contains.html

Bisaloo commented 1 year ago

Upon testing s2, it appears that it works exclusively for geometry on a sphere and is therefore not appropriate for our use case.

Alternatives are:

thomased commented 1 year ago

Ah right - thanks. I wouldn’t mind copying some code in the long run since it’s just to support that one tiny use, but I’m not up on weaving in cpp.

How about just using the working solution you’ve got for now, and aiming for a neater solution next release?

I’ve got some new features I’d like to get done, so release after this one should only be a 2-3 months.