Skip to contents

Published workflows

sptrends is not a collection of individual statistical functions – it is a platform for published workflows. Each one below is a complete, citable, peer-reviewed method with its own paper, not an ad hoc combination this package invented: Robust Trend Analysis (RTA, Gutiérrez-Hernández & García, 2024) and True Significant Trends (TST, Gutiérrez-Hernández & García, 2025). See ?workflow_tst and ?workflow_rta for how the two differ and why both are offered, rather than one superseding the other. print()/summary()/plot() work the same way on every classed object this package returns – one shared entry point per generic (the same convention terra itself uses), not a differently-named function to remember for each result type.

workflow_tst()
True Significant Trends (TST): the full pipeline in one call
workflow_rta()
Robust Trend Analysis (RTA): the full pipeline in one call
print(<sptrends>)
Print a sptrends result
summary(<sptrends>)
Summarise a sptrends result
plot(<sptrends>)
Plot a sptrends result

Configurable trend workflow

workflow_trends() is not itself a published method – it lets you assemble your own combination of the same prewhitening, trend testing, slope estimation and multiple-testing correction methods the two published workflows above are built from, for the case where neither matches what a given analysis needs. Returns the same kind of object print()/summary()/plot() recognise – see “Published workflows” above.

workflow_trends()
Configure a monotonic or linear trend-analysis workflow

Preprocessing

Steps applied to the raw raster time series before trend estimation or significance testing – removing serial autocorrelation or seasonality that would otherwise distort the steps that come after. Neither is one of the core trend-analysis pillars itself; both prepare the input for them. prewhiten() returns a classed result with print()/summary()/plot() methods. compute_anomalies() returns a plain list: pass $anomalies to the next stage and inspect its rasters with terra::plot().

prewhiten()
AR(1) prewhitening of raster time series
compute_anomalies()
Remove the seasonal cycle from raster time series

Core methods

The classical, individually citable statistical techniques each published workflow above is built from – every one of them usable standalone, not only as a step inside workflow_tst()/workflow_rta(). Each function’s own help page traces it back to its original publication. The four raster analysis functions return classed results with print()/summary()/plot() methods. The vector FDR helpers and neighbourhood builder return lists described in their respective help pages.

trend_test()
Trend tests for raster time series
prepare_cmk_neighbourhood()
Precompute a CMK spatial neighbourhood
slope_estimator()
Slope estimators for raster time series
fdr_correction()
Apply false discovery rate (FDR) correction to multiple p-values
spatial_autocorrelation()
Permutation-based spatial autocorrelation tests

Diagnostics

What remains standalone after the redesign: the interactive single-cell inspector. Every other diagnostic previously listed here (trend/Theil-Sen/prewhitening/FDR/Moran’s I summaries, histograms, maps, category labels, and the FDR-masked direction map) is now reached via print()/summary()/plot() on the relevant object – see “Published workflows” and “Core methods” above.

inspect_ts_cell()
Inspect a single cell's (or area's) raw time series interactively

Utilities

Everything else this platform needs around the science: reading gridded time series in, simulating synthetic ground truth, benchmarking detection methods against it, and the bundled real-world example dataset. compare_detections() also returns an object print()/summary()/plot() recognise – see “Published workflows” above – while remaining an ordinary data frame underneath (indexing, $, and so on all still work).

read_ordered_stack()
Read and chronologically order a folder of raster files
read_netcdf_stack()
Read and chronologically order a single multi-temporal NetCDF file
sim_trend_stack()
Generate a synthetic gridded time series with known true trends
simulation_design()
Build a factorial design of simulation scenarios
example_data()
Path to sptrends' bundled example dataset
compare_detections()
Compare detection methods against a known ground truth
benchmark_methods()
Benchmark statistical methods across known-truth simulation scenarios
benchmark_summary()
Summarise a method benchmark across Monte Carlo replicates