This function calculates Gamma of irreplaceability. Inputs can be either a
vector of Alpha values, or a data.frame containing all necessary
parameters needed to calculate Alpha values on a row-by-row basis.
Vector Gamma measurement: If data is a vector of
Alpha irreplaceability values, a single Gamma value will be calculated and
returned.
Dataframe Gamma measurement: If data is a
data.frame and local, global and target are
strings representing field names in data, a vector of Alpha
irreplaceability values will be caluclated using these fields, and a Gamma
if irreplaceability value will be calculated on these, and returned.
Usage
gamma(
data,
local = NULL,
global = NULL,
target = NULL,
triage = FALSE,
na.rm = TRUE
)
Value
A number
Arguments
data
vector or data.frame - The input over which to calculate Gamma.
local
string - The name of the column containing the feature's
representation at the site. Needed if data is a data.frame
global
string - The name of the column containing the feature's total
available representation. Needed if data is a data.frame
target
string - The name of the column containing the feature's target.
Needed if data is a data.frame
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.rm
logical - Should lines with missing values (NA) be ignored? If
data is a vector, NA values will be removed when calculating Gamma. If
data is a data.frame, Alpha values will be calculated using
alpha with na.allow set to TRUE, and then Gamma
calculated ignoring NA values.