Skip to contents

Maps indicators returned by assess_extrapolation(), in the style of plot_prediction(). plot() of the result does the same.

Usage

plot_extrapolation(x, indicator = "extrapolation", ...)

# S3 method for class 'RiskMap_extrapolation'
plot(x, ...)

Arguments

x

The result of assess_extrapolation().

indicator

Indicator to map: "extrapolation" (the default, the four classes, with the thresholds that assess_extrapolation() used), "spatial_unexplained" (the share of the spatial variance left unexplained by the data, on a scale from 0 to 1), "covariate_novelty" or "covariate_leverage". Several indicators are arranged in two columns.

...

For plot(), the arguments of plot_extrapolation(). For plot_extrapolation(), not used, and an error if given, so that a misspelt argument is not ignored.

Value

A ggplot object, to which further layers can be added. When several indicators are requested, a patchwork object combining one ggplot per indicator.

Examples

data(italy_sim)
example_data <- italy_sim[1:150, ]
fit <- glgpm(y ~ log(pop_dens) + gp(), data = example_data,
             family = "gaussian", messages = FALSE)
extrapolation <- assess_extrapolation(fit, italy_sim[151:200, ])
plot_extrapolation(extrapolation)

# The same map
plot(extrapolation)