rspatial / geodata

download geographic data
GNU General Public License v3.0
147 stars 15 forks source link

`worldclim_country()` for more than one country #46

Open AMBarbosa opened 1 year ago

AMBarbosa commented 1 year ago

When the country argument for worldclim_country() has length >1, only the first element is used, and the other are silently ignored.

tavg <- geodata::worldclim_country(country = c("Luxembourg", "Netherlands", "Belgium"), var = "tavg", path = tempdir())
terra::plot(tavg[[1]])
terra::plot(vect(system.file("ex/lux.shp", package="terra")), add = TRUE)  # only Luxembourg was taken

I think there should be at least a warning about this, or (ideally) the function could take more than one country at a time.