Description Usage Arguments Details Value Author(s) References Examples
Prepare data for an attribute-ordered network plot.
1 | prepAON(ranks, edge.list)
|
ranks |
Numeric vector with names matching those in edge.list. No check is made to ensure these match 1:1, onus on user. |
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. |
User should format edge.list so it looks like the example data (exInput).
A list object, prepped for use in plotting an attribute-ordered network.
Elizabeth A. Hobson, https://sites.google.com/site/hobsonresearch/
Hobson, E. A., D. J. John, T. L. Mcintosh, M. L. Avery, and T. F. Wright. 2015. The effect of social context and social scale on the perception of relationships in monk parakeets. Current Zoology 61:55-69.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #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)]
}
prepped <- prepAON(results, exInput)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.