Learn R Programming

proxirr (version 0.5)

.alpha: Calculate Alpha Irreplaceability

Description

This function calculates Alpha Irreplaceability for a single feature.

Usage

.alpha(local, global, target, triage = FALSE, na.allow = FALSE)

Value

A number between 0 and 1.

Arguments

local

numeric - The feature's local representation at the site.

global

numeric - The feature's globally available representation.

target

numeric - The feature's target.

triage

logical - Should features with unachievable targets be ignored? Defaults to FALSE. If FALSE, these species will be always assigned an Alpha irreplaceability of 1 wherever they occur. If TRUE, these species will always be assigned an Alpha irreplaceabiltiy of 0.

na.allow

logical - Return NA if NA values are found in the inputs?

Author

Daniele Baisero, daniele.baisero@gmail.com

Details

If na.allow is TRUE and any of the required values is NA, returns NA.

If triage is set to TRUE, alpha irreplaceability is set to 0 if the target cannot be achieved (i.e., if the target is greater than the global value), and calculated normally otherwise.

References

tools:::Rd_expr_doi("10.1111/cobi.13806")

Examples

Run this code
.alpha(local=0,    global=100,  target=50)
.alpha(local=15,   global=100,  target=50)
.alpha(local=35,   global=100,  target=50)
.alpha(local=49.5, global=100,  target=50)
.alpha(local=55,   global=100,  target=50)
.alpha(local=100,  global=100,  target=0)
.alpha(local=5,    global=100,  target=110)
.alpha(local=5,    global=100,  target=110, triage=TRUE)
.alpha(local=32,   global=100,  target=NA, na.allow = TRUE)

Run the code above in your browser using DataLab