Skip to content

metaRangeSpecies object

Creates an species object in form of an R6 class that stores and handles all the parts that define a species.

  • name: <string> name or ID of the species.
  • processes: <list> of <metaRangeProcesses>. The processes that describe how the species interacts with the environment, itself and other species.
  • traits: <environment> holds the traits of the species.
  • sim: <metaRangeSimulation> A reference to the metaRangeSimulation simulation object that the species is part of. Useful to access environmental data or data of other species.

Creates a new metaRangeSpecies object

metaRangeSpecies$new(name, sim)
  • name: <string> name or ID of the species.
  • sim: <metaRangeSimulation> A reference to the metaRangeSimulation simulation object that the species is part of. Useful to access environmental data or data of other species.

A <metaRangeSpecies> object.

# The following is only for illustration purposes!
# species should be added to a simulation via the `add_species` method
# of the simulation object.
sim_env <- terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2))
test_sim <- metaRangeSimulation$new(source_environment = sim_env)
sp <- metaRangeSpecies$new(name = "species_01", sim = test_sim)
sp

Prints information about the species to the console

metaRangeSpecies$print()

<invisible self>

A <metaRangeSpecies> object.

## ------------------------------------------------
## Method `metaRangeSpecies$new`
## ------------------------------------------------
# The following is only for illustration purposes!
# species should be added to a simulation via the `add_species` method
# of the simulation object.
sim_env <- terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2))
test_sim <- metaRangeSimulation$new(source_environment = sim_env)
sp <- metaRangeSpecies$new(name = "species_01", sim = test_sim)
sp