# \donttest{
extd.dir <- system.file("extdata", package = "pacu")
## List of zipped Sentinel files in a directory
s2a.files <- list.files(extd.dir, '\\.zip', full.names = TRUE)
area.of.interest <- sf::st_read(file.path(extd.dir, 'cobs_a_aoi.shp'))
## computing ndvi
ndvi <- pa_compute_vi(satellite.images = s2a.files,
vi = 'ndvi',
aoi = area.of.interest,
check.clouds = TRUE)
## computing ndre
ndre <- pa_compute_vi(satellite.images = s2a.files,
vi = 'ndre',
aoi = area.of.interest,
check.clouds = TRUE)
## specifying a differente vegetation index, in this case, the
## excess green index
egi <- pa_compute_vi(satellite.images = s2a.files,
vi = 'other',
formula = EGI ~ (2 * B03) - B02 - B04,
aoi = area.of.interest,
check.clouds = TRUE)
# }
Run the code above in your browser using DataLab