if (FALSE) {
# path to all example files
path <- system.file('extdata', package = 'hydrotoolbox')
# build the snih station file
guido <-
hm_create() %>%
hm_build(bureau = 'snih', path = path,
file_name = c('snih_hq_guido.xlsx',
'snih_qd_guido.xlsx'),
slot_name = c('hq', 'qd'),
by = c('none', 'day') ) %>%
hm_name(slot_name = 'qd',
col_name = 'q(m3/s)')
# apply a moving average windows to streamflow records
hm_mutate(obj = guido, slot_name = 'qd',
FUN = mov_avg, k = 10,
pos = 'c', out_name = 'mov_avg') %>%
hm_plot(slot_name = 'qd',
col_name = list(c('q(m3/s)', 'mov_avg') ),
interactive = TRUE,
line_color = c('dodgerblue', 'red3'),
y_lab = 'Q(m3/s)',
legend_lab = c('original', 'mov_avg') )
}
Run the code above in your browser using DataLab