| alpha {proxirr} | R Documentation |
Calculate Alpha Irreplaceability
Description
This function calculates Alpha irreplaceability. Inputs can be single
parameter values needed to calculate Alpha, vectors of parameter values to
calculate a vector of Alpha values, or a data.frame with columns
containing parameters needed to calculate a vector of Alpha values.
-
Single Alpha measurement: If
local,globalandtargetare numeric, it calculates and returns Alpha irreplaceability. -
Vectorized Alpha measurement: If
local,globalandtargetare vectors of the same length, a vector of Alpha irreplaceability values will be calculated and returned. -
Dataframe Alpha measurement: If
dfis provided andlocal,globalandtargetare strings representing field names indf, a vector of Alpha irreplaceability values will be caluclated and returned. Optionally: Ifalpha_colis also provided, adata.frameidentical todfwill be returned with the calculated Alpha values in thealpha_colcolumn.
Usage
alpha(
local,
global,
target,
df = NULL,
alpha_col = NULL,
triage = FALSE,
na.allow = NULL,
overwrite = FALSE
)
Arguments
local |
number, vector or string - The feature's representation at the site, or the name of the column containing the feature's representation at the site. |
global |
number, vector or string - The feature's globally available representation, or the name of the column containing the feature's globally available representation. |
target |
number, vector or string - The feature's target, or the name of the column containing the feature's target. |
df |
data.frame - Optional; an input data.frame. |
alpha_col |
string - The name of the column where to write alpha values. If both df and alpha_col are provided, the output will be the input dataframe with the additional column. |
triage |
logical - Should features with unachievable targets be ignored?
Defaults to |
na.allow |
logical - Allaw |
overwrite |
logical - Should |
Value
A number, vector or data.frame
Author(s)
Daniele Baisero, daniele.baisero@gmail.com
Examples
alpha(1, 100, 45)
alpha(c(1,25,45), c(100,100,100), c(50,50,50))
dtfrm = data.frame(
loc = c(1,25,45),
glob = c(100,100,100),
targ = c(50,50,50)
)
alpha('loc', 'glob', 'targ', df = dtfrm)