swd_format It reshapes your occurrence and background information using the format samples with data (swd) to run maxent with an ordinary samples file.

swd_format(
  env_layers,
  nbg = NULL,
  occs_points,
  sp_name = "sp",
  longitude,
  latitude
)

Arguments

env_layers

A raster stack or brick with the environmental information.

nbg

Number of points for the background data.

occs_points

A data frame with longitude and latitude data.

sp_name

Species name. Default sp_name="sp".

longitude

Column name containing longitude data.

latitude

Column name containing latitude data.

Value

A list with the occurrence or/and background points in swd format. Note that coordinates correspond to pixel centroids

Details

The difference between the typical way of running MaxEnt models and it is that the program doesn’t need to look in the environmental layers to obtain values for the variables at the sample points or the background points. each time that you call maxent (see maxent_call). One of the main advantages is that MaxEnt runs much faster see section SWD Format here https://biodiversityinformatics.amnh.org/open_source/maxent/Maxent_tutorial2017.pdf for details.

Examples

if (FALSE) { # Bioclimatic layers path wcpath <- list.files(system.file("extdata/bios", package = "ntbox"), pattern = ".tif$",full.names = TRUE) # Bioclimatic layers wc <- raster::stack(wcpath) # Occurrence data for the giant hummingbird (Patagona gigas) pg <- utils::read.csv(system.file("extdata/p_gigas.csv", package = "ntbox")) pg_swd <- ntbox::swd_format(env_layers=wc, nbg=10000, occs_points =pg, sp_name="p_gigas", longitude = "longitude", latitude = "latitude") head(pg_swd$occs_swd) head(pg_swd$bg_swd) }