toporanga: A catch-all function to access package functionality in one...

View source: R/toporanga.R

toporangaR Documentation

A catch-all function to access package functionality in one call

Description

The general pipeline of toporanga is to tally the domination events, optionally modify the tally by diffusing event weights and/or re-scoring reciprocal weights, arrange agents into an order represented by an acyclic graph, finally to reduce it to an order or a dominance score. This function collects all of this into a single call.

Usage

toporanga(
  winning,
  opposing,
  weight,
  ...,
  agents,
  diffuse = FALSE,
  reciprocals = c(),
  output = c("parameters", "graph", "order_sample", "subordinate_count"),
  epochs
)

Arguments

winning

vector of IDs of winning agents.

opposing

vector of IDs of opposing agents.

weight

optional weight of the event; set to 1 for each event if not given.

...

ignored.

agents

optional vector of IDs of all agents; allows for ghost agents that are in the set but are not involved in any event.

diffuse

if TRUE, weight diffusion is applied. See diffuse for more details.

reciprocals

a vector of commands applied to the tally. "keep" does nothing; "marginise" reduces weights into weight margins, see marginise, "zero" zeroes opposing weights, see zero_opposition, "normalise" normalises weights within conflicts, see normalise; "diffuse" applies diffuse, allows to manage order in which diffuse is mixed with other modifiers; cannot be mixed with diffuse=TRUE. Normally, diffuse is applied first.

output

specifies what to return from the function. "parameters" returns the some agent parameters, see parameters; "graph" a toporanga_graph object; "order_sample" an order of agents; in case multiple is possible, a single random sample; "subordinate_count" a count of subordinate agents for each agent, which can be interpreted as a dominance score.

epochs

optional driver for applying analysis on subsets of events. See cumulative_epochs and window_epochs for more information. If given, changes the output to an aggregated version of whatever was selected with output.

Value

A result of the caclulation in a form specified by the output argument, aggregated over epochs is epochs argument is given.

Examples

data(EcoHAB)
toporanga(EcoHAB$winner,EcoHAB$loser)

toporanga documentation built on Aug. 8, 2025, 6:15 p.m.