gr_plot_minmonth: Plot minimum runoff month

View source: R/plot.R

gr_plot_minmonthR Documentation

Plot minimum runoff month

Description

Generate a histogram of a minimum runoff month for two periods: before and after the change year set by year parameter.

Usage

gr_plot_minmonth(
  df,
  year = NULL,
  exclude = NULL,
  tests = NULL,
  pagebreak = FALSE,
  print = TRUE
)

Arguments

df

data.frame of hydrograph and meteorological variables as produced by gr_summarize().

year

Integer. Change year value to separate two periods.

exclude

Integer vector of years to be excluded from plotting.

tests

Tests list for the same variables (generated by gr_test_vars() function)

pagebreak

Logical. Whether to break page between plots (needed for reporting). Defaults to FALSE.

print

Boolean. Print plot? Defaults to TRUE. Use FALSE if you want to tweak the plot aesthetics before plotting.

Value

list of two ggplot2 objects, representing the histogram of a minimum runoff month for two periods: before and after the change year

Examples

library(grwat)

data(spas) # example Spas-Zagorye data is included with grwat package

# separate
sep = gr_separate(spas, params = gr_get_params(reg = 'center'))

# summarize from 1965 to 1990
vars = gr_summarize(sep, 1965, 1990)

# plot minimum runoff month for two periods divided by Pettitt test
gr_plot_minmonth(vars, tests = gr_test_vars(vars))

# plot minimum runoff month for two periods divided by fixed year
gr_plot_minmonth(vars, year = 1978)

tsamsonov/grwat documentation built on Feb. 10, 2024, 5:55 p.m.