Description Usage Arguments Details Value References Examples
Calculate the modified form of Bradley-Terry coefficients for all species in an input edge list.
1 | myBTM(edge.list, cores)
|
edge.list |
A data frame of observations, with the first column as the dominant species/individual and the second column as the subordinate species/individual. |
cores |
The number of cores to use for parallel processing. Specify 'seq' to run sequentially. |
User should format edge.list so it looks like the example data (exInput). The returned object can have odd names. This can be fixed using agrep, per the example.
Named vector of Bradley-Terry coefficients for all species in edge.list.
Miller, E. T., D. N. Bonter, C. Eldermire, B. G. Freeman, E. I. Greig, L. J. Harmon, C. Lisle, and W. M. Hochachka. 2017. Fighting over food unites the birds of North America in a continental dominance hierarchy. biorxiv https://doi.org/10.1101/104133
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #load in the example data
data(exInput)
#run the Bradley Terry function. takes a few seconds to run.
results <- myBTM(edge.list=exInput, cores=2)
#the names of these scores have weird periods in them. use agrep to solve
species <- unique(c(as.character(exInput$source), as.character(exInput$target)))
names(results) <- sub("..", "", x=names(results))
for(i in 1:length(results))
{
names(results)[i] <- species[agrep(names(results)[i], species, max.distance=0.1)]
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.