Get elevation data from Copernicus 30m or GEBCO 2023. Run get_elev(rast)
with any raster to get elevation data from online.
The function chooses which source based on the distance across the centre cell of the query raster, if that is less than 'threshold' it goes for the 30m SRTM source "cop30".
Requires in-dev terra, see install instructs in code below
library(terra)
#> terra 1.7.41