You can install srtmVN
from
GitHub
# install.packages("devtools")
devtools::install_github("epix-project/srtmVN", build_vignettes = TRUE)
Once installed, you can load the package:
library(srtmVN)
The RasterLayer
DEM from SRTM can be retrieved with the getsrtm
function:
srtm <- getsrtm()
#> Loading required package: raster
#> Loading required package: sp
It’s a RasterLayer
object:
srtm
#> class : RasterLayer
#> dimensions : 17796, 8790, 156426840 (nrow, ncol, ncell)
#> resolution : 0.0008333333, 0.0008333333 (x, y)
#> extent : 102.1446, 109.4696, 8.562917, 23.39292 (xmin, xmax, ymin, ymax)
#> crs : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
#> source : /Library/Frameworks/R.framework/Versions/3.6/Resources/library/srtmVN/extdata/srtm90.tif
#> names : srtm90
#> values : -129, 3106 (min, max)
that can be plotted with the plot
method:
plot(srtm)