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

`spatialBlock` outdated 'scale' argument for ggplot2::guides #25

Closed AMBarbosa closed 1 year ago

AMBarbosa commented 1 year ago

Dear Roozbeh, Running spatialBlock() with all packages at their latest CRAN versions, I now get:

Warning messages:
1: The `<scale>` argument of `guides()` cannot be `FALSE`. Use
"none" instead as of ggplot2 3.3.4.
ℹ The deprecated feature was likely used in the blockCV
  package.
  Please report the issue to the authors.

This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this
warning was generated. 

Running lifecycle::last_lifecycle_warnings(), I get:

[[1]]
<warning/lifecycle_warning_deprecated>
Warning:
The `<scale>` argument of `guides()` cannot be `FALSE`. Use
"none" instead as of ggplot2 3.3.4.
ℹ The deprecated feature was likely used in the blockCV
  package.
  Please report the issue to the authors.
---
Backtrace:
 1. blockCV::spatialBlock(...)
 2. ggplot2::guides(fill = FALSE)
 3. ggplot2:::deprecate_warn0("3.3.4", "guides(`<scale>` = 'cannot be `FALSE`. Use \"none\" instead')")

Cheers,

rvalavi commented 1 year ago

Dear @AMBarbosa thank you so much for the report (and the previous ones). I'm working on blockCV right now, trying to resolve all these issues and release v3.0 with many changes including using terra (with support for starts and raster objects); adding hexagon blocks (now, default), adding spatial cluster (xy cluster) and some other features. I try to finish in the next few days. Any issue report on the new version is very much appreciated.

AMBarbosa commented 1 year ago

Cool, I'll move to v3.0 when it comes out! And since you're adding support for 'terra', it would be great if you'd remember to include not just class SpatRaster, but also SpatVector (as an alternative to sf) for vector map inputs, as per https://github.com/rvalavi/blockCV/issues/20#issue-1092691481. Cheers!

rvalavi commented 1 year ago

Thanks! The new version will take any vector data that is convertible to an sf object (SpatVector is one of them). For raster, it will even accept files on disk or anything that can be convertible to a SpatRaster.

rvalavi commented 1 year ago

blockCV is updated and this warning is resolved; I'm closing this issue!