fix_PPTdata_length: Adds/removes elements of data

Description Usage Arguments Details Value

View source: R/ExtractData_ClimateDownscaling.R

Description

Adds/removes elements of data until identical(length(data), targetLength)

Usage

1
fix_PPTdata_length(data, targetLength, seed = NA)

Arguments

data

A numeric vector. Daily values of precipitation.

targetLength

An integer value.

seed

A seed set, NULL, or NA. NA will not affect the state of the RNG; NULL will re-initialize the RNG; and all other values are passed to set.seed.

Details

Removal of elements is by random sampling. Addition of elements is by randomly placing them within the sequence of days of data and them randomly assigning values of the original data with replacement.

Value

A copy of data with adjusted length.


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