Skip to contents

Creates a virtual species on a small grid, samples presence and absence points, and produces several "model" rasters of varying quality. This lets you test the workflow without any of your own data.

Usage

simulate_enm_data(n_presence = 100, n_absence = 300, seed = NULL)

Arguments

n_presence, n_absence

Number of points to sample.

seed

Optional random seed.

Value

A list with models (a multi-layer SpatRaster, values 0-1), presence and absence (data.frames with lon and lat columns) and truth (the true suitability raster) and env (two environmental predictor layers, env1 and env2, scaled 0-1, for fitting your own models).

Examples

sim <- simulate_enm_data(seed = 42)
terra::plot(sim$models)