bin_env {nichevol}R Documentation

Helper function to prepare bin tables

Description

Helper function to prepare bin tables

Usage

bin_env(overall_range, M_range, sp_range, bin_size)

Arguments

overall_range

(numeric) minimum and maximum values of all species and Ms to be analyzed.

M_range

matrix of ranges of environmental values in M for all species. Columns must be minimum and maximum, and rows correspond to species.

sp_range

matrix of ranges of environmental values in occurrences for all species. Columns must be minimum and maximum, and rows correspond to species.

bin_size

(numeric) size of bins. Range of environmental values to be considered when creating each character in bin tables. See details.

Details

The argument bin_size helps to create characters that represent not only one value of an environmental variable, but a range of environmental conditions. For instance, if a variable of precipitation in mm is used, a value of 10 for bin_size indicates that each character will represent a class that correspond to 10 continuous values of precipitation (e.g., from 100 to 110 mm).

Value

A character matrix (table of characters) containing bins for a given variable and for all species considered. See more details in bin_tables.

Examples

# example
o_range <- c(1, 25)
m_range <- rbind(c(5, 15), c(10, 23), c(4, 20))
s_range <- rbind(c(7, 15), c(12, 21), c(3, 18))

# bin preparation
bins <- bin_env(overall_range = o_range, M_range = m_range,
                sp_range = s_range, bin_size = 1)

[Package nichevol version 0.1.20 Index]