## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>",
                      fig.width = 6, fig.height = 4.5)

## ----setup, include = FALSE---------------------------------------------------
library(sptrends)
r <- terra::rast(
  sort(list.files(
    example_data("vhp_ndvi"),
    pattern = "\\.tif$",
    full.names = TRUE
  ))
)

## ----theil-sen-map, fig.alt = "Global map of raw Theil-Sen NDVI slopes"-------
years <- 1982:2023
ts <- slope_estimator(
  r, method = "TS", t = years,
  report = FALSE, verbose = FALSE
)
plot(ts)

