qm_vol: Monthly river discharge [m3/s] to volume [hm3]

Description Usage Arguments Value Examples

View source: R/ff_qm_vol.R

Description

Converts mean monthly river discharge [m3/s] to total volume discharge [hm3].

Usage

1
qm_vol(x, col_name, out_name = NULL)

Arguments

x

data frame with class Date in the first column and numeric on the others.

col_name

string with column(s) name(s) where to apply the function.

out_name

optional. String with new column(s) name(s). If you set it as NULL, the function will overwrite the original data frame.

Value

The same data frame but with the total volume discharge.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# read guido daily streamflow records
path <- system.file('extdata', 'snih_qd_guido.xlsx',
        package = 'hydrotoolbox')

# read, aggregate the function to monthly resolution and get the volume
qm_guido <-
  read_snih(path = path, by = 'day', out_name = 'q(m3/s)') %>%
  agg_table(col_name = 'q(m3/s)', fun = 'mean', period = 'monthly',
            out_name = 'qm(m3/s)') %>%
  qm_vol(col_name = 'qm(m3/s)', out_name = 'vm(hm3)')

hydrotoolbox documentation built on July 9, 2021, 1:06 a.m.