Computes monthly or annual areal statistics of vegetation indices
(NDVI, EVI, or SAVI) from MODIS MOD13A1 (500 m, 16-day composite)
for a given spatial region, applying quality filtering via the
DetailedQA bitmask.
Arguments
- region
An
sfobject (polygon or multipolygon). Must be in a geographic CRS (or will be reprojected to WGS84 internally).- from
Character. Start date in
"YYYY-MM-DD"format. Valid range:"2000-02-18"onwards.- to
Character. End date in
"YYYY-MM-DD"format.- band
Character. Vegetation index to extract. One of
"NDVI","EVI", or"SAVI". Default:"NDVI".- by
Character. Temporal aggregation unit. One of
"month"(default) or"year".- fun
Character. Zonal statistic to compute over the region. One of
"mean","max","min","median","sum","sd","first". Default:"mean".- scale
Numeric. Nominal scale in metres for the GEE projection. Default:
500(native MOD13A1 resolution).- sf
Logical. If
TRUE, returns ansfobject with geometries attached. Default:FALSE.- quiet
Logical. If
TRUE, suppresses the progress bar. Default:FALSE.
Value
A tibble (or sf tibble if sf = TRUE) in long format:
<id_cols>Original attribute columns from
region.dateDateobject. First day of each month (by = "month") or first day of each year (by = "year").variableName of the vegetation index (e.g.
"NDVI").valueComputed zonal statistic for that region and period.
Details
Temporal aggregation
MODIS MOD13A1 produces one composite every 16 days. This function aggregates those composites into a coarser temporal unit:
by = "month": All 16-day images within each calendar month are reduced to a single image usingmax()(maximum value composite), yielding one value per region per month.by = "year": All 16-day images within each calendar year are reduced to a single image usingmax(), yielding one value per region per year.
The fun argument controls the spatial (zonal) statistic applied
over each region polygon, and is independent of the temporal aggregation.
Credits
Pioneering geospatial health analytics and open‐science tools. Developed by the Innovalab Team, for more information send a email to imt.innovlab@oficinas-upch.pe
Follow us on :
Examples
if (FALSE) { # \dontrun{
library(land4health)
library(geoidep)
rgee::ee_Initialize(quiet = TRUE)
provinces <- get_provinces(show_progress = FALSE) |>
subset(nombdep == "LORETO")
# Monthly mean NDVI
result_monthly <- provinces |>
l4h_vegetation(
from = "2010-01-01",
to = "2012-12-31",
band = "NDVI",
by = "month",
fun = "mean",
sf = TRUE
)
# Annual mean NDVI
result_annual <- provinces |>
l4h_vegetation(
from = "2010-01-01",
to = "2020-12-31",
band = "NDVI",
by = "year",
fun = "mean",
sf = TRUE
)
} # }






