convert_anidom: Convert displacements for use by functions from the aniDom...

View source: R/convert.R

convert_anidomR Documentation

Convert displacements for use by functions from the aniDom package

Description

Converts displacements data into a format for easy use by either the aniDom::elo_scores(), the aniDom::estimate_uncertainty_by_repeatability(), or the aniDom::estimate_uncertainty_by_splitting() functions included in the aniDom package for calculating dominance hierarchies from Elo scores and assessing their robustness. Only includes individuals that participated in at least one interaction.

Usage

convert_anidom(d)

Arguments

d

Data frame or List. Either the specific displacements data frame which is returned as a list item from disp(), or the whole displacements list returned by disp().

Value

A data frame listing winners and losers of all displacements sorted by time of the event.

See Also

aniDom package and it's functions: elo_scores, estimate_uncertainty_by_repeatability, and estimate_uncertainty_by_splitting. https://cran.r-project.org/package=aniDom

Examples


# Calculate displacements
d <- disp(visits(finches_lg))

# Format for use in aniDom's elo_scores
i <- convert_anidom(d)
i <- convert_anidom(d$displacements) # Equivalent

# Use aniDom functions:

## Not run: 
library(aniDom)

# Calculate elo_scores
s <- elo_scores(winners = i$winner, losers = i$loser)

# Estimate repeatability
r1 <- estimate_uncertainty_by_repeatability(winners = i$winner, losers = i$loser)
r2 <- estimate_uncertainty_by_splitting(winners = i$winner, losers = i$loser, randomise = TRUE)


## End(Not run)


animalnexus/feedr documentation built on Feb. 2, 2023, 1:12 a.m.