Learn R Programming

Dominance (version 1.2.0)

FDI: Function FDI

Description

Calculate FDI - the Frequency Based Dominance index.

Usage

FDI(data_sheet, bytes, ...)

Arguments

data_sheet

either a data.frame f.e imported from a data sheet containing "Name","item.number" "action.from.","action.to","kind.of.action" "name.of.action","action.number","classification","weighting"

or only "action.from.","action.to","kind.of.action"if exists actions and items

actions: with "name.of.action","action.number","classification","weighting items: with "Name","item.number"

bytes

a string where each enabled action is set to 1 and each disabled action is set to 0 Setting a behaviour to 2 means it is count double

Additional parameters:

actions

(data.frame) with "name.of.action","action.number","classification","weighting"; Classification 1 if "action.from"" wins; Classification 2 if "action.to" wins

Weighting

the factor which should be used to calculate the behavior (1 for "action.from"" wins -1 for "action.to" wins") Setting a behaviour to 2 means it is count double

vcolors

as much colors as items, colors will returned as sorted FDI colors means color 1 = item rank 1, color 2 = item rank 2, and so on

Value

returns a list with FDI - the Frequency Based Dominance index Colors - the colors supported by vcolors sorted by FDI of the items FDI_count_matrix - the counts from which the FDI was calculated

References

The Construction of Dominance Order: Comparing Performance of Five Methods Using an Individual-Based Model C. K. Hemelrijk, J. Wantia and L. Gygax, Behaviour Vol. 142, No. 8 (Aug., 2005), pp. 1037-1058 10.1163/156853905774405290 On using the DomWorld model to evaluate dominance ranking methods , de Vries, Han, Behaviour, Volume 146, Number 6, 2009 , pp. 843-869(27) 10.1163/156853909X412241

Examples

Run this code
# NOT RUN {
{ #you can eihter use:
data_sheet=data.frame   ("action.from"=c(1,4,2,3,4,3,4,3,4,3,4,3,4,3,4),
                         "action.to"=c(4,1,1,4,3,4,3,4,3,4,3,4,3,4,3),
"kind.of.action"= c(4,1,1,4,3,4,3,4,3,4,3,4,3,4,3),stringsAsFactors=FALSE)
items= data.frame ("Name"=c("item1","item2","item3","item4","item5","item6") ,
                   "item.number"=c(1:6),stringsAsFactors=FALSE)
actions=data.frame("name.of.action"= c("leading","following","approach","bite","threat to bite",
                                      "kick","threat to kick", "chase","retreat"),
                  "action.number"=c(1:9),
                  "classification"=c(1,2,1,1,1,1,1,1,2) ,
                  "weighting"=c(1,-1,1,1,1,1,1,1,-1),stringsAsFactors=FALSE)
#all  encounters  without leading and following
bytes= "001111111"  
FDI(data_sheet,items=items,actions=actions,bytes)
# or you can use a complete f.e Excel sheet
# you can save this data as basic excel sheet to work with
data(data_ADI)
bytes= "001111111"  
FDI(data_ADI,bytes)
   }
# }

Run the code above in your browser using DataLab