rast <- rnaturalearth::ne_download(category = "raster", type = "HYP_50M_SR_W", scale = 50)
#> Warning: The `returnclass` argument of `ne_download()` sp as of rnaturalearth 1.0.0.
#> ℹ Please use `sf` objects with {rnaturalearth}, support for Spatial objects
#> (sp) will be removed in a future release of the package.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: /tmp/RtmpV6NNlD/HYP_50M_SR_W/HYP_50M_SR_W.tif: No such file or
#> directory (GDAL error 4)
#> Error: [rast] file does not exist: /tmp/RtmpV6NNlD/HYP_50M_SR_W/HYP_50M_SR_W.tif
Reprex:
Created on 2023-11-21 with reprex v2.0.2
The problem is that
HYP_50M_SR_W.tif
is not in theHYP_50M_SR_W
subdir. Thishttps://github.com/ropensci/rnaturalearth/blob/704772792ecafb0f29b9f68089fdab80ccf4cb43/R/ne_download.R#L138
Might need to be