Description Usage Arguments Value Note Examples
hyet_window_sum
computes the rolling sum of
values. Returns an error if prec
is not a numeric vector or
rolling_window
not a positive integer.
1 | hyet_window_sum(prec, rolling_window)
|
prec |
a numeric vector |
rolling_window |
an integer that represents the rolling window as a number of time steps. |
a numeric vector with summed precipitation values. These values are filled with NAs at the end.
Computing time depends on rolling_window
. hyet_window_sum
use R's base rowSums
function with na.rm = TRUE
.
1 2 3 4 5 6 7 8 9 10 11 | # load data
data(prec5min)
# fill hyetograph
hyet <- hyet_fill(prec5min, 5)
# set rolling window sum to 6 records
rolling_window <- 6
# compute values
roll_sums <- hyet_window_sum(hyet$prec, rolling_window)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.