movingKendallSlope: Moving Kendall Slope on Single or Regional Time-Series

Description Usage Arguments Value

View source: R/movingKendallSlope.R

Description

Calculates a Mann-Kendall significance level and a Sen's slope (if single data.frame) or regional/seasonal Kendall slope (if list of data.frames) for a given time window within a larger time interval, with the time window moving incrementally to cover the specified time interval.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
movingKendallSlope(
  data,
  valuesColumn,
  timeColumn,
  start,
  end,
  valuesUnits = "mm",
  timeUnits = "years",
  period = 10
)

Arguments

data

A data.frame or a list containing the data.frames (one per site or season) to test. Must contain a column of type numeric with the data to be analyzed, and a matching integer column in sequence representing years, months, days, or other regular interval. Data frames in a list can be of different lengths but must have identical column names. Use as.data.frame if selecting a list element.

valuesColumn

The column name of the values to be tested.

timeColumn

The column name of the date/time representative integer values.

start

The first data point (year, month, day, etc) that will be considered in the rolling trend calculations (first calculated slope is from start:(end + period)). This year must be present in at least one of the data.frames in the supplied list.

end

The last data point (year, month, day, etc) considered in the rolling trend calculations.

valuesUnits

A character vector describing the data you are analyzing.

timeUnits

A character vector describing the time units ("days", "years", "months").

period

The length of the moving window.

Value

A data.frame with three columns: one column of p-values, one column of regional Kendall slopes (for lists) or Sen's slopes (data.frame), and one column showing the last data point (year, month, day, etc) used in the calculations.


gdelaplante/WRBTrends documentation built on Feb. 18, 2022, 2:36 a.m.