gr_plot_tests | R Documentation |
The function extracts change years from results of gr_test_vars()
and plots their probability density. Since for every variable the change year is individual, this procedure allows finding the one most probable year, which is the mode of the distribution. This year is highlighted by the line and labeled on the plot.
gr_plot_tests(tests, type = "year", print = TRUE)
tests |
|
type |
Character string type of the plot. Currently only |
print |
Boolean. Print plot? Defaults to |
ggplot2
object representing the selected type of the tested variable
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)
# test all variables
tests = gr_test_vars(vars)
# plot change year from Pettitt test
gr_plot_tests(tests, type = 'year')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.