Skip to contents

The predicted-to-expected (P/E) ratio against the predicted value, as estimated by boyce_index(): the moving-window ratios, or the smoothed curve with its bootstrap band (on a log scale, as the smoothed ratio spans orders of magnitude). A ratio above 1 (dotted line) means presences are more frequent there than in the background.

Usage

plot_boyce(x, base_size = 11, file = NULL, width = 2100, height = 1500)

Arguments

x

A result of boyce_index() with details = TRUE or n_boot > 0.

base_size

Base font size.

file

Optional file(s) to save the plot to, e.g. "fig.pdf" or c("fig.png", "fig.pdf"); the format follows the extension, and a name without extension is saved as PNG and PDF. The plot is also returned.

width, height

Size of the saved figure in pixels (PDF and SVG at 300 pixels per inch).

Value

A ggplot object.

References

Liu, C., Newell, G., White, M., Machunter, J. (2024) Improving the estimation of the Boyce index using statistical smoothing methods for evaluating species distribution models with presence-only data. Ecography 2025, e07218. doi:10.1111/ecog.07218

Examples

set.seed(1)
b <- boyce_index(rbeta(30, 4, 1), runif(1000), smooth = "spline",
                 details = TRUE)
plot_boyce(b)