View source: R/ff_swe_derive.R
swe_derive | R Documentation |
Derive melt or snowfall series from snow water equivalent measurements (snow pillows measurements).
swe_derive(x, col_name, out_name = NULL, case)
x |
data frame or tibble with class Date or POSIX* in the first column. |
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 |
case |
string vector with "sf" (meaning snowfall) or "m" (meaning melt). |
The same data frame but with the derived series.
# set path to file
path_file <- system.file('extdata', 'dgi_toscas.xlsx',
package = 'hydrotoolbox')
# swe table
swe_toscas <- read_dgi(path = path_file,
sheet = 'swe',
out_name = 'swe(mm)')
# add melt and snowfall
swe_toscas <-
swe_toscas %>%
swe_derive(col_name = rep('swe(mm)', 2),
out_name = c('melt(mm)', 'snowfall(mm)'),
case = c('m', 'sf') )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.