species_suitability {TroublemakeR}R Documentation

Calculate species suitability

Description

Calculate species suitability from a given raster and species names and writes them to a .dat file. The file will be written to the location specified by the name argument. If the file already exists, it will be overwritten. The file format is plain text, with each line terminated by a newline character.

Usage

species_suitability(
  Rastercurrent,
  species_names,
  name = "Problem",
  verbose = FALSE
)

Arguments

Rastercurrent

raster object of current suitability

species_names

character vector of species names

name

The name of the output file

verbose

Logical whether messages will be written while the function is generating calculations, defaults to FALSE

Value

.dat file. This function is used for the side-effect of writing values to a file.

Examples

library(terra)
data(Current)
Current <- terra::unwrap(Current)
species_suitability(Rastercurrent = Current, species_names = c("Spp1", "Spp2", "Spp3", "Spp4"))

file.remove("Problem.dat")

[Package TroublemakeR version 0.0.1 Index]