beta: Calculate Beta Irreplaceability

Description Usage Arguments Value Author(s) Examples

View source: R/alphabeta.R

Description

This function calculates Beta 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.

Usage

1
2
3
4
5
6
7
8
beta(
  data,
  local = NULL,
  global = NULL,
  target = NULL,
  triage = FALSE,
  na.rm = TRUE
)

Arguments

data

vector or data.frame - The input over which to calculate Beta.

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 Beta. If data is a data.frame, Alpha values will be calculated using alpha with na.allow set to TRUE, and then Beta calculated ignoring NA values.

Value

A number

Author(s)

Daniele Baisero, daniele.baisero@gmail.com

Examples

1
2
3
4
5
6
7
beta(c(0.01, 0.5, 0.5))
dtfrm = data.frame(
  loc = c(1,25,45),
  glob = c(100,100,100),
  targ = c(50,50,50)
)
beta(dtfrm, local = 'loc', global = 'glob', target = 'targ')

proxirr documentation built on Nov. 14, 2021, 1:07 a.m.