hydrograph: Hydrograph plus Hyetograph

Description Usage Arguments Details Note Author(s) Examples

View source: R/hydrograph.R

Description

The function to plot a hyetograph over a hydrograph based on ggplot functions.

Usage

1
2
3
4
5
6
7
8
9
hydrograph(
  data,
  time = time,
  runoff = Runoff,
  rain = Rain,
  agg.time_unit = "3 hours",
  agg.window = 8,
  vsep = 0.5
)

Arguments

data

tbl or Data frame object.

time

Vector name of timestamp variable in 'data'.

runoff

Vector name of Runoff variable in 'data'.

rain

Vector name of Rainfall variable in 'data'.

agg.time_unit

Integrer. Default "3 hours". Time lag unit to aggregate rainfall bars by sum function. This will be showed as light blue line of hyetrograph.

agg.window

Integrer. Default 8. Value of number o values from rainfall data to aggregate by rolling mean function. This will be showed as dark blue line of hyetrograph.

vsep

numeric. Default 0.5. Value between 0 and 1 to scale the vertical separation of hyetograph from hydrograph. 1 means 100 between min and max runoff.

Details

ggplot2 object is generated. Other functions passed to theme() guides() or labs() can be used to customize the hydrograph.

Note

Based on the request at https://stackoverflow.com/q/42057832

Author(s)

Gabriel Gaona

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# ploting soil moisture
data("soil_moisture")
#
hydrograph(data = soil_moisture,
    time = timestamp,
    runoff = runoff,
    rain = rain,
    agg.time_unit = "day",
    agg.window = 7) +
    ggplot2::theme_light()+
    ggplot2::theme(legend.position = "bottom")

gavg712/hydroutils documentation built on Dec. 27, 2019, 2:22 a.m.