chirps
chirps copied to clipboard
get_chirps using a SpatRaster?
I'm working on writing tests to improve the test coverage for the package (and hopefully stop the automated e-mails that the tests failed).
Right now I'm working on get_chirps()
for the SpatRaster
method but I'm getting an error.
r <- rast(system.file("ex/elev.tif", package = "terra"))
x_raster <- get_chirps(r, dates, server = "CHC", as.raster = TRUE)
Results in an error.
Error in `[.data.frame`(lonlat, , 2) : undefined columns selected
Am I just using the function incorrectly?
There is an issue in the S3 methods, for some reason it does not go the get_chirps.SpatExtent or get_chirps.SpatRaster or get_chirps.SpatVector and goes to the default method which gives this error. I tried to fix without success and wrote a turn around solution that you can find here https://github.com/ropensci/chirps/commit/f6da1c664049d9f598d1823805c05b7e14823a3a. Is not an elegant way to solve, but is the one I found considering our limited time. What do you think?
It happens also to me. Probably can you remove this possibility from the package? Thank you