variogram_sews_plot: Early-warning signals based on variograms

variogram_sews_plotR Documentation

Early-warning signals based on variograms

Description

Plot trends of indicators based on variograms

Usage

## S3 method for class 'variogram_sews'
plot(x, along = NULL, ...)

plot_variogram(x, along = NULL, ...)

## S3 method for class 'variogram_sews'
plot_variogram(x, along = NULL, ...)

## S3 method for class 'variogram_sews_test'
plot(x, along = NULL, what = "value", display_null = TRUE, ...)

## S3 method for class 'variogram_sews_test'
plot_variogram(x, along = NULL, what = "value", display_null = TRUE, ...)

Arguments

x

An object produced by variogram_sews, or the result of applying indictest on such object.

along

A vector providing values along which the indicator trends will be plotted. If NULL then the indicator values are plotted sequentially in their original order.

...

Other arguments are ignored.

what

The trendline to be displayed. Defaults to the indicator's values ("value") but other metrics can be displayed. Accepted values are "value", "pval", "difference" (obs - null mean), or "z_score" ( (obs - null mean) / (null sd) ).

display_null

Chooses whether a grey ribbon should be added to reflect the null distribution. Note that it can not be displayed when the trend line reflects something else than the indicator values (when what is not set to "value").

Details

The plot() function will display how the estimated variogram parameters change along a set of values (passed with argument along). If the object passed has been processed through indictest, then the null values are also displayed. plot_variogram() can be used to display the individual variograms that have been fit to the data.

See Also

variogram_sews, indictest, plot_variogram

Examples

  
 
serengeti_ews <- variogram_sews(serengeti, model ="exp")

# Display the change in variogram parameters 
plot(serengeti_ews, along = serengeti.rain) + 
  ggplot2::labs(x = "Rainfall (mm)")

# Visualize the fitted variograms
plot_variogram(serengeti_ews, along = serengeti.rain) 

  # Test the trends (nulln should be set to a higher value to obtain 
  # meaningful results
  serengeti_test <- indictest(serengeti_ews, nulln = 19)
  plot(serengeti_test, along = serengeti.rain)
  plot_variogram(serengeti_test, along = serengeti.rain)



spatialwarnings documentation built on Sept. 11, 2024, 8:55 p.m.