Closed maurobio closed 1 year ago
The error says that there is not function 'dropLayer' in the terra package. Here are examples how to drop a layer: https://github.com/rspatial/terra/issues/664#issuecomment-1150794478
This is not really the place for Q&A (see e.g. stackoverflow for that),
Anyway, currentEnv
is a SpatRaster
(a class defined by "terra") but you are treating it like a RasterStack
or RasterBrick
(from the "raster" package). This means that you may have to either change more things in your script, or use
library(raster)
currentEnv <- as(currentEnv, "Raster")
Thanks, Mr; Hijmans, that's the kind of little trick which makes a world of difference! No, It solved my problem and right now I have been able to use geodata successfully.
Em qua., 21 de set. de 2022 às 23:49, Robert Hijmans < @.***> escreveu:
This is not really the place for Q&A (see e.g. stackoverflow for that),
Anyway, currentEnv is a SpatRaster (a class defined by "terra") but you are treating it like a RasterStack or RasterBrick (from the "raster" package). This means that you may have to either change more things in your script, or use
library(raster) currentEnv <- as(currentEnv, "Raster")
— Reply to this email directly, view it on GitHub https://github.com/rspatial/geodata/issues/27#issuecomment-1254449526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPMACIKJKPL7RL6333U52TV7PCNHANCNFSM6AAAAAAQL2B32A . You are receiving this because you authored the thread.Message ID: @.***>
-- Dr. Mauro J. Cavalcanti E-mail: @.*** Web: https://github.com/maurobio "Life is complex. It consists of real and imaginary parts."
Hi
I am trying to adapt the example from here (https://rstudio-pubs-static.s3.amazonaws.com/224303_df34f170cd9144cda6477ae8232887f7.html), which uses the CMIP5 data (now obsolete), to the latest WorldClim models (http://www.worldclim.org/) using the new CMIP6 data,
For retrieving the data, I am using the geodata package.
Here is the script as far as I could run it:
[edited to just show the relevant part]
Could a working example of using the latest CMIP6 data with geodata be provided?