Skip to contents

Simulate species habitats with correlations across space and among species

Usage

sim_habitat(
  critters,
  kp,
  critter_correlations = NA,
  resolution,
  patch_area,
  rescale_habitat = TRUE,
  max_delta = 3,
  max_abs_cor = 1,
  output = "df"
)

Arguments

critters

a vector of critters names of length n_species representing the number of species to be simulated

kp

a rate parameter that governs the rate at which spatial cells become decorrelated with distance. Lower values mean a smoother (more correlated) habitat map

critter_correlations

leave as NA to randomly simulate correlations across species. Otherwise, a n_species x n_species correlation matrix

resolution

the resolution of the system

patch_area

Value

a list with simulated critter habitats

Examples


n_species <- 6

critters <- paste0(fruit[1:n_species],"_fish")
#> Error: object 'fruit' not found

resolution <- c(4,20)

patch_area =  4

kp = .1


species_distributions <- sim_habitat(critters = critters, resolution = resolution, patch_area = patch_area, kp = kp)
#> Error: object 'critters' not found