lsat_calc_trend: Calculate non-parametric vegetation greenness trends

View source: R/lsat_calc_trend.R

lsat_calc_trendR Documentation

Calculate non-parametric vegetation greenness trends

Description

This function evaluates and summarizes interannual trends in vegetation greenness for sample sites over a user-specified time period. Potential interannual trends in vegetation greenness are assessed using either (1; default) Mann-Kendall trend tests and Theil-Sen slope indicators after prewhitening each time series or (2) linear regression. The default trend assessment method relies on the zyp.yuepilon() function from the zyp package, which provides further details.

Usage

lsat_calc_trend(
  dt,
  si,
  yrs,
  yr.tolerance = 1,
  nyr.min.frac = 0.66,
  sig = 0.1,
  method = "mk"
)

Arguments

dt

Data.table with columns including site, year, and the vegetation index of interest.

si

Spectral index for which to assess trend (e.g., NDVI).

yrs

A sequence of years over which to assess trends (e.g., 2000:2020).

yr.tolerance

The number of years that a site's first/last years of observations can differ from the start/end of the user-specified time period ('yrs') for a trend to be computed.

nyr.min.frac

Fraction of years within the time period for which observations must be available if a trend is to be computed.

sig

A p-value significance cutoff used to categories trends (e.g., 0.10)

method

Specify whether trends should be computed using Mann-Kendall tests ("mk"; default) or linear regression ("lm")

Value

A list that includes: (1) a summary message about the mean relative change across sample sites; (2) a data.table summarizing the number and percentage of sites that fall into each trend category; (3) a data.table with trend statistics for each sample site.

Examples

data(lsat.example.dt)
lsat.dt <- lsat_format_data(lsat.example.dt)
lsat.dt <- lsat_clean_data(lsat.dt)
lsat.dt <- lsat_calc_spectral_index(lsat.dt, 'ndvi')
# lsat.dt <- lsat_calibrate_rf(lsat.dt, band.or.si = 'ndvi', write.output = F)
lsat.pheno.dt <- lsat_fit_phenological_curves(lsat.dt, si = 'ndvi') 
lsat.gs.dt <- lsat_summarize_growing_seasons(lsat.pheno.dt, si = 'ndvi')
lsat.trend.dt <- lsat_calc_trend(lsat.gs.dt, si = 'ndvi.max', yrs = 2000:2020)
lsat.trend.dt

logan-berner/lsatTS documentation built on Oct. 21, 2024, 12:23 a.m.