RMevents_sample: RMevents_sample

View source: R/RMevents_sample.R

RMevents_sampleR Documentation

RMevents_sample

Description

Compute rainfall event variables based on time series of rain data with only one rain gage or one mean radar rain column. The function does not calculate events based on the rain data itself (such as in RMevents), but rather calculates event variables based on an input of sample/event start and end times.

Usage

RMevents_sample(
  dfrain,
  ieHr = 6,
  rain = "rain",
  time = "pdate",
  dfsamples,
  bdate = "bpdate",
  edate = "epdate"
)

Arguments

dfrain

dataframe with rainfall

ieHr

numeric Interevent period in hours, defaults to 6,

rain

string Column name of rainfall unit values, defaults to "rain"

time

string column with as.POSIXctdate, defaults to "pdate"

dfsamples

dataframe with the beginning and ending dates and times of sampling periods in POSIXct format

bdate

character column name in dfsamples for the beginning of the sampling period

edate

character column name in dfsamples for the ending of the sampling period

Value

list of storms and storms2

Examples

RDB <- CedarRRain
cedarSamples <- cedarSamples
names(RDB)[2] <- "UVRain"
RDB2 <- RMprep(RDB,prep.type=1,date.type=1,
               dates.in="CST.Time",tz="CST6CDT")
eventListSamples <- RMevents_sample(df=RDB2,ieHr=6,
                                    rain="UVRain",
                                    time="pdate",
                                    dfsamples=cedarSamples,
                                    bdate="pSstart",edate="pSend")

USGS-R/Rainmaker documentation built on Oct. 11, 2022, 6:05 a.m.