## ----echo=FALSE--------------------------------------------------------------- ## ----mplot, message=FALSE----------------------------------------------------- datadir <- file.path(dirname(tempdir()), "_modis") mf <- file.path(datadir, "MOD09A1.A2009361.h21v08.061.2021149144347.hdf") library(terra) r <- rast(mf[1]) r ## ----imgp1-------------------------------------------------------------------- crs(r) ## ----imgp2-------------------------------------------------------------------- dim(r) nrow(r) ncol(r) # Number of layers (bands) nlyr(r) ncell(r) ## ----imgp3-------------------------------------------------------------------- res(r) ## ----imgp5-------------------------------------------------------------------- names(r) ## ----plotrgb------------------------------------------------------------------ # Create an image RGB composite plot plotRGB(r, r = 1, g = 4, b = 3) # Disappointing? apply some stretching; see `?plotRGB` for more options plotRGB(r, r = 1, g = 4, b = 3, stretch="lin")