autoplot_overview_stations: wrapper function to show boxplots and index values of...

Description Usage Arguments Output Details See Also Examples

View source: R/autoplot_overview_stations.R

Description

This function calculates different indices at station level and then combines their climatology as boxplots in one graphic. Optionally selected years can be added as points (e.g. the current year or some years of special interest.)
To see some example outputs of this function, look at the vignette "autoplot-functions" accesible through the package help main page or by typing
vignette("autoplot-functions",package="ClimIndVis") into the console.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
autoplot_overview_stations(
  dat_p,
  indices,
  indices_args,
  selpoints = NULL,
  addyears = NULL,
  yearcols = 1:length(addyears),
  yearpchs = 18,
  yearcex = 3,
  NAmaxClim = 20,
  output = NULL,
  plotdir,
  plotname = "",
  plot_title = TRUE,
  title = "",
  graphic_device
)

Arguments

dat_p

Climindvis-object with type = "p" generated by make_object.

indices

Character array of indices to be calculated.

indices_args

List containing a list of index arguments for each index. See calc_index.

selpoints

Optional integer array of stations to select for plotting. Default= NULL (all stations are plottet).

addyears

Optional array of years (integer or character) to add as points to the plot. Default=NULL.

yearcols

Optional array of same length as addyears with colors for marking selected years. Entries have to be valid arguments to col2rgb. Default=1:length(addyears)

yearpchs

Optional array of pch for each year. Default= 18

yearcex

Optional magnification to be used for year symbols. Default=3

NAmaxClim

Integer [0,100]. Maximum percentage of years with missing values for calculation of climatology. If exceeded value for respective grid point/station is set to NA. Default = 20 ( = 20"%").

output

Format of image to be plotted ("png", "jpeg", "tiff", "pdf","dev.new"). Default = NULL, output to null device (getOption("device") will show you the null device. If you are not using RStudio, NULL and dev.new will give the same output).

plotdir

Character string of path of directory for saving plots. Ignored if output is NULL or "dev.new".

plotname

Optional. Character string. First part of plot name followed by character string containing index name/aggregation/time period/... depending on the autoplot function. Default = "".

plot_title

Logical. Add plot title to graphic. Default = TRUE.

title

Optional. Character string. If provided added above the plot in addition to default information from the respective function (e.g. index name/aggregation/time period/...). Default = "", no additional title is written.

graphic_device

Optional arguments for graphics devices (in addition to filename, width and height ), depending on the output chosen see png or pdf. Ignored if output is NULL or "dev.new".

Output

This function returns one plot per station and temporal aggregation whch is covered by the data( e.g. if aggt="seasonal" it would return 4 graphics, one for each season).

If output is not NULL or "dev.new" the graphics are directly saved in the user specified directory (plotdir) with the following filename structure:

plotname // "overview_indices" // aggregation // years // addyears //station_name// output
e.g.:
plotname"_overview_indices_MAM_1981-2010_add2018_station2.png

Details

The selected indices are grouped by their units (e.g. mm, %, no of days,...) before plotting.

See Also

Other autoplot_functions: autoplot_anomaly_map(), autoplot_anomaly_ts(), autoplot_climatology_map(), autoplot_forecast_map(), autoplot_forecast_spi(), autoplot_forecast_stations(), autoplot_trend_map(), autoplot_ts_stations(), autoplot_verification_map()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
indices = c("dd", "fd", "th", "tx90p", "cdd", "sdii")

aggt = "seasonal"
indices_args = list(dd = list(aggt = aggt),
                   fd = list(aggt = aggt),
                   th = list(aggt = aggt, th = 5, thvar = "prec", op = ">"),
                   tx90p = list(aggt = aggt),
                   cdd = list(aggt = aggt),
                   sdii = list(aggt = aggt)
                   )


autoplot_overview_stations(dat_p = object_st, indices = indices, indices_args = indices_args,
                          addyears = 1981, selpoints = 1)

Climandes/ClimIndVis documentation built on Oct. 24, 2021, 10:52 a.m.