ncsu-landscape-dynamics / rpops

PoPS (Pest or Pathogen Spread) R Package
https://ncsu-landscape-dynamics.github.io/rpops/
GNU General Public License v3.0
10 stars 5 forks source link

terra::as.points does not have fun and spatial parameters #82

Closed wenzeslaus closed 3 years ago

wenzeslaus commented 3 years ago

Unlike rasterToPoints, terra::as.points does not have fun and spatial parameters. The current code:

  suitable_points <- terra::as.points(suitable,
                                    fun = function(x) {
                                      x > 0
                                    },
                                    spatial = TRUE)

produces:

Error: unused arguments (fun = function(x) {
    x > 0
}, spatial = TRUE)

with devtools::test().

Discovered in #81. Terra introduced in #79.

wenzeslaus commented 3 years ago

This initially surfaced with #81, but now it is there for every PR/change which is actually more expected.