Skip to contents

This function generates a ggplot figure for comparing WGN parameters between two datasets for specified stations.

Usage

plot_wgn_comparison(
  meteo_lst1,
  meteo_lst2,
  station1,
  station2,
  type1 = "set 1",
  type2 = "set 2",
  title = "comparison"
)

Arguments

meteo_lst1

First nested list with dataframes. Nested structure: meteo_lst -> data -> Station ID -> Parameter -> Dataframe (DATE, PARAMETER), meteo_lst -> stations -> Dataframe (ID, Name, Elevation, Source, geometry, Long, Lat).

meteo_lst can be created using load_template function using 'xlsx' template file or it could to be created with load_swat_weather function loading information from SWAT+ model setup weather files.

meteo_lst2

Second nested list with dataframes. Same structure as meteo_lst1.

station1

Character, ID of one station in the first list selected for comparison (example "ID1").

station2

Character, ID of one station in the second list selected for comparison (example "ID1").

type1

(optional) Character, naming of the first dataset (example "measured"). Default type1 = "set 1".

type2

(optional) Character, naming of the second dataset (example "netCDF"). Default type2 = "set 2".

title

(optional) Character, information to be added in the figure title. Default title = "comparison".

Value

ggplot figure of bar plots.

Examples

if (FALSE) {
##Loading data
temp_path <- system.file("extdata", "weather_data.xlsx", package = "SWATprepR")
met_lst <- load_template(temp_path)
##Plotting
plot_wgn_comparison(met_lst, met_lst, "ID9", "ID2", "Samszyce", "Glebokie", "comparison")
}