calcranks: add dominance indices to a data set given a dominance matrix

Description Usage Arguments Details Value Examples

View source: R/calcranks.R

Description

add dominance indices to a data set given a dominance matrix

Usage

1
calcranks(mat, respdata, radagio = TRUE)

Arguments

mat

a dominance matrix, most likely from datagenfunc

respdata

a data.frame that contains a ID column, which in turn contains IDs that appear in mat

radagio

logical, by default TRUE, see details

Details

currently, four metrics are calculated:

All metrics are returned twice, on their original scale and z-transformed. In addition, the 'true rank' (referred to in the rank column) is also z-transformed.

This function adds new columns to xdata. For this to work, xdata has to have at least two columns with the name ID and rank.

If radagio = FALSE, the function returns ranks as individuals ranked by their proportion of wins. This is meant as a testing strategy because running the ADAGIO algorithm in turn requires the Java ADAGIO software to be run, which first of all is very slow and also interupts workflow because this produces a pop-up window to appear for each instance. The intended use of this argument is to try out simulations that require the calcrank() function. If the simulation works, then this argument can be set to radagio = TRUE (its default).

Value

a data.frame with metrics added

Examples

1
2
3
4
5
6
## Not run: 
domdata <- datagenfunc(gs = 5, Nintm = 3)
xdata <- createresponse(domdata[[2]], 2, effectsize = 2, error = 0.5)
calcranks(domdata[[1]], xdata)

## End(Not run)

gobbios/radagio documentation built on Dec. 26, 2019, 6:13 p.m.