raster::getData() function alternative

Hello everyone, I'm trying to adecuate my script to the new recomended packages (sp -> sf, raster -> terra, etc), and I can not find any alternative to the getData() function in the terra or star package.

I would like to achive something as simple as download directly global bioclimatic data from worldclim site, in the previous version (with raster) the code was like this:
"climVar<- getData('worldclim', var = "bio", res = 5)"

I'm aware that at this point not all functionalities and compatibilites are posible with these new packages (e.g. I
had to use sp classes in a previous step instead the sf ones), but I'm kinda new with R and I thought that maybe there is another solution I'm not able to see/find/realise yet.

Thank you in advance for your time.

It looks like the {mapme.biodiversity} package does this, with the added benefit of an included worldclim dataset.

1 Like

Thank you very much for answering so quickly! I was not aware of that package and it really seems very useful. However I have found a package that works more like the replacement I was looking for, the "geodata" package.


Quick Guide:

The structure is almost the same:
climVar <- worldclim_country(country= "ES", var="bio", res=0.5, path= "./Output", version = "2.1")

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.