ACP.calculator: Antecedental Rainfall (and temperature) Accumulation...

Description Usage Arguments Value Examples

View source: R/ACPcalculator.R

Description

Takes the Complete Time Series Vegetation Index and a table of every possible accumulation period and offset period for precipitation and temperature(optional). A OLS is calculated lm for every combination of VI ~ rainfall (and temperature if that is included). if only the VPR is being calculated, this Function preferences those results where slope>0 (increase in rainfall causes an increase in vegetation),returning the rainfall accumulation that has the highest R-squared and a positive slope. If no combination produces a positive slope then the one with the highest R-squared is returned.

Usage

1
2
3
4
5
6
7
ACP.calculator(
  CTSR.VI,
  ACP.table,
  ACT.table = NULL,
  allow.negative = FALSE,
  allowneg.retest = FALSE
)

Arguments

CTSR.VI

Complete Monthly Time Series of Vegetation Index values. An object of class 'ts' object without NA's.

ACP.table

A table of every combination of offset period and accumulation period.for precipitation ACP.table can be calculated using the climate.accumulator.

ACT.table

A table of every combination of offset period and accumulation period.for temperature ACP.table can be calculated using the climate.accumulator.

allow.negative

If true, will not preference positive slope in either CTSR or VI calculations. default=FALSE is set because negative associations between rainfall and vegetation in water limited ecosystems is unexpected If temperature data is included then this paramter is forced to TRUE.

allowneg.retest

default=FALSE If temperature data is provided but found to not be significant then a retest is performed. This paramter is to allow negative on re-test.

Value

A list containing:

summary a Matrix containing "slope", "intercept", "p.value", "R^2.Value", "Break.Height", "Slope.Change" of the lm between Antecedental Rainfall Accumulation (CTSR.RF) and the CTSR.VI

CTSR.precip see CTSR.RF in TSSRESTREND for description

CTSR.osp The offest period for the complete time series rainfall

CTSR.acp The accumulation period for the complete time series rainfall

CTSR.tmp The optimally accumulated CTS temperature

CTSR.tosp The offest period for the complete time series temperature

CTSR.tacp The accumulation period for the complete time series temperature

Examples

1
2
3
4
5
6
7
#Find the data
vi.path <- system.file("extdata", "rabbitVI.csv", package = "TSS.RESTREND", mustWork = TRUE)
in.VI <- read.csv(vi.path)
CTSR.VI <- ts(in.VI, start=c(1982, 1), end=c(2013,12), frequency = 12)
data(rabbitACPtable)
ACPres <- ACP.calculator(CTSR.VI, rabbitACPtable)
print(ACPres$summary)

Example output

       slope    intercept      p.value    R^2.Value Break.Height Slope.Change 
4.071642e-04 1.111209e-01 1.365472e-40 3.727418e-01          NaN          NaN 

TSS.RESTREND documentation built on Aug. 3, 2020, 1:07 a.m.