antecedent_precip: Compute antecedent precipitation

Description Usage Arguments Value Examples

Description

Computes antecedent precipitation as a rolling sum. Time series must be continuous at hourly intervals

Usage

1
2
antecedent_precip(x, period = 48, delay = 0, fun = sum,
  value.name = "Precip", datetime.name = "Datetime")

Arguments

x

Dataframe of hourly precipitation values

period

Duration of antecedent period as hours (default=48)

delay

Shift in the antecedent period as hours (default=0)

fun

Function applied to each period (e.g. sum, max)

value.name

Name of precipitation column

datetime.name

Name of date/time column

Value

numeric vector of antecedent precipitation for given period, delay, and fun

Examples

1
2
3
4
5
filepath <- system.file("extdata", "LoganPrecip.xlsx", package = "myrwaR")
pcp <- load_precip_from_xls(filepath, as.type='dataframe')
pcp$Precip.48 <- antecedent_precip(pcp, period=48, delay=0,
                                   datetime.name="Datetime",
                                   value.name="Precip")

walkerjeffd/myrwaR documentation built on May 3, 2019, 10:46 p.m.