add_delta_to_PPT: Additive Precipitation adjustment by a delta value

Description Usage Arguments Details Value

View source: R/ExtractData_ClimateDownscaling.R

Description

Additive Precipitation adjustment by a delta value

Usage

1
2
3
4
5
6
add_delta_to_PPT(
  data,
  ind_events = NULL,
  addDelta = NULL,
  deltaPerEvent = NULL
)

Arguments

data

A numeric vector. Daily values of precipitation.

ind_events

A logical or integer vector of the same length as data or NULL. If logical, then TRUE/FALSE for each element/day of data whether it precipitates or not. If integer, then the indices of data on which it precipitates. If NULL, then it will be calculated as data > 0.

addDelta

A numeric value or NULL. The total amount of precipitation that is to be added/removed from data[ind_events] together (divided among events), i.e., it requires the same unit as data.

deltaPerEvent

A numeric vector of the length equal to sum(ind_events) or NULL. The daily amount of precipitation that is to be added/removed from each data[ind_events], i.e., it requires the same unit as data.

Details

Provide one of the arguments addDelta or deltaPerEvent, but not both. The value of addDelta will be evenly split up among ind_events.

Value

A list with two elements

data

A copy of data with adjusted values.

PPT_to_remove

The total amount of precipitation that could not be removed from data due to lack of precipitation.


Burke-Lauenroth-Lab/rSFSW2 documentation built on Aug. 14, 2020, 5:20 p.m.