Description Usage Arguments Value Examples
View source: R/precip_cumsum.R
Returns a data frame with two columns: the date and the cumulative sum of the chosen col_number
. This function can deal with NA_real_
.
1 | precip_cumsum(df, col_number = 2, out_name = NULL)
|
df |
data frame with |
col_number |
numeric. The column number of the series where to apply the cumulative sum. |
out_name |
optional. String value with the column output name. Default is 'cumsum_' plus the original name. |
A data frame with two columns: date and the cumulative sum of the series.
1 2 3 4 5 6 7 8 | # Load daily precipitation data-set from BDHI
load( paste0(system.file('extdata', package = "hydroToolkit"), '/bdhi_p.rda') )
# Get compact slot
p_bdhi <- get_hydroMet(obj = bdhi_p, name = 'compact')[[1]]
# Apply cumulative precipitation function
p_cum <- precip_cumsum(df = p_bdhi, col_number = 2, out_name = 'cum_guido')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.