autoplot_trend_map: Wrapper function to calculate and plot trend of indices.

Description Usage Arguments Details Output See Also Examples

View source: R/autoplot_trend_map.R

Description

This function calls the function calc_index and plots the significant trend values in a map. It can be used for either gridded or station data or a combination of both.
To see some example outputs of this function, look at the vignette "autoplot-functions" accessible 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
autoplot_trend_map(
  dat_grid,
  dat_p,
  index,
  index_args = list(),
  abs = TRUE,
  sig_lev = 0.05,
  selyears = NULL,
  title = "",
  plot_title = TRUE,
  plot_args = list(),
  output = NULL,
  plotdir,
  plotname = ""
)

Arguments

dat_grid

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

dat_p

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

index

Name of index to be calculated., e.g. index = "dd" or index = "tnn". For list of indices see indices_list

index_args

List of arguments for index. See indices_list.

abs

Logical. Plot absolute trend (unit/decade) instead of relative trend (percentage change relative to middle time). Default = TRUE. For indices with continuous temperature values (e.g. TNN, TNX, etc.), no relative trend is calculated.

sig_lev

Level of significance. Only significant trend estimates are plotted. Default = 0.05.

selyears

Integer array of years to be selected from data. For indices with quantiles, years as defined in index_args are used for quantile calculation, but only selected years are plotted. For functions using seasonal forecast data, selyears is only applied to hindcasts.

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.

plot_title

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

plot_args

Optional. List of arguments passed to plotting function, see plot_args_map.

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 = "".

Details

For every index a default method is used for the trend calculation. The default trend estimation and test depends on the nature of the calculated index:

For continuous data (e.g. sum, mean, prcptot, spi) by default an ordinary linear regression is calculated with time as predictor for the trend estimate and applying a students-t test for significance testing. If the data is not normaly distributed, a logarithmic transformation is applied before the trend calculation, e.g. for precipitation sums.

For count data (e.g dd, cdd, cwd) by default a logistic regression is calculated with time as predictor for the trend estimation and applying a students-t test for significance testing. In the calculation, a correction for overdispersion is applied.

If you set trend = "MannKendall" inside the list of index arguments (index_args), the non-parametric Mann-Kendall test based on the relative ranking in the series is applied and a Theil-Sen slope is estimated. See e.g. Yue et al. 2002 or Mann (1945), Kendall (1975) for further references.

Output

This function returns one plot per temporal aggregation which is covered by the data( e.g. aggt="seasonal" returns 4 graphics, one for each season).

Trends of station data are depicted as ascending and descending triangles. The size of the triangles depends on the range of trends available. If output is not NULL or "X11" the graphics are saved in the user specified directory (plotdir) with the following filename structure:

plotname // index name // aggregation // "abs-/rel_trend" // years // output
e.g.:
plotname"_dry_days_MAM_rel-trend_1981-2010.png

See Also

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

Examples

1
2
3
data(object_st,object_grid)
autoplot_trend_map(dat_grid=object_grid,
                         index="mean",index_args=list(var="tmax",aggt="seasonal",selagg="SON"))

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