Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_chirps using a SpatRaster? #43

Open
adamhsparks opened this issue Apr 20, 2022 · 2 comments
Open

get_chirps using a SpatRaster? #43

adamhsparks opened this issue Apr 20, 2022 · 2 comments

Comments

@adamhsparks
Copy link
Member

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?

@kauedesousa
Copy link
Member

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 f6da1c6. Is not an elegant way to solve, but is the one I found considering our limited time. What do you think?

@ecor
Copy link

ecor commented Feb 20, 2024

It happens also to me. Probably can you remove this possibility from the package? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants