rvalavi / blockCV

The blockCV package creates spatially or environmentally separated training and testing folds for cross-validation to provide a robust error estimation in spatially structured environments. See
https://doi.org/10.1111/2041-210X.13107
GNU General Public License v3.0
107 stars 24 forks source link

Issues with next version of ggplot2 #17

Closed thomasp85 closed 3 years ago

thomasp85 commented 3 years ago

Hi

We are preparing a new ggplot2 release and our tests have shown that blockCV has some issues with it. It is specifically related to a change in how non-sf layers behave when mixed with sf layers. Before, any non-sf layer was considered to be encoded in whatever CRS the coordinate system used, whereas it now is considered to be encoded in sf::st_crs(4326) (i.e. latitude and longitude values). To get the old behaviour set default_crs = NULL in coord_sf().

We plan to submit the next version of ggplot2 on May 31st

best Thomas

rvalavi commented 3 years ago

Hi Thomas,

Thanks for reporting this, I'll change this, update the package and push it CRAN.

Cheers, Roozbeh

rvalavi commented 3 years ago

Dear @thomasp85 I check the functions in blockCV and none uses coord_sf() directly but most of them are plotting sf + non-sf objects. Actually, I want the new behaviour of ggplot to be used in my package (i.e., all ggplots be encoded to sf::st_crs(4326)). As this is the default behaviour of ggplot now, do I need to add coord_sf(crs = sf::st_crs(4326)) in my codes?

thomasp85 commented 3 years ago

No — if you want the new behaviour you just need to make sure that your non-sf layers encode data in longitude/latitude coordinates