plot_trajectories {aniDom} R Documentation

## Plot the Elo trajectories of individuals

### Description

Plot the trajectories of Elo scores after each interaction

### Usage

```plot_trajectories(trajectories, colors = NULL)
```

### Arguments

 `trajectories` The output of `elo_scores` with the return.trajectories option set to TRUE: an Nx(T+1) matrix (where T is the number of interactions). `colors` An optional vector of colours for each line (default = "black").

### Details

Plots one set of trajectories. If the randomise option in `elo_scores` is set to TRUE, then the resulting matrices should be passed one at a time.

### Value

Generates a plot. No data is returned.

### Author(s)

Written by Damien R. Farine & Alfredo Sanchez-Tojar

Maintainer: Damien R. Farine <damien.farine@ieu.uzh.ch>

### References

Sanchez-Tojar, A., Schroeder, J., Farine, D.R. (in prep) Methods for inferring dominance hierarchies and estimating their uncertainty.

### Examples

```
# Set population size
N <- 10

# Set shape parameters
a = 15
b = 3

# Generate data
data <- generate_interactions(N,100,a,b)

# Extract data (and turn IDs into letters for this example)
winners <- letters[data\$interactions\$Winner]
losers <- letters[data\$interactions\$Loser]
identities <- letters[data\$hierarchy\$ID]

# Calculate Elo scores
scores <- elo_scores(winners,losers,identities=identities,
randomise=FALSE,return.trajectories=TRUE)

# Plot results
plot_trajectories(scores, colors=rainbow(N))

```

[Package aniDom version 0.1.5 Index]
{"ft_lang_label":"__label__en","ft_lang_prob":0.5088754,"math_prob":0.79929423,"size":1180,"snap":"2021-43-2021-49","text_gpt3_token_len":293,"char_repetition_ratio":0.1292517,"word_repetition_ratio":0.0,"special_character_ratio":0.22966102,"punctuation_ratio":0.16080402,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98693633,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-12-07T00:49:40Z\",\"WARC-Record-ID\":\"<urn:uuid:f4c237d9-631a-40f8-9c74-10ec41b689c4>\",\"Content-Length\":\"3045\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9ce49d88-0fc9-4ae9-8f13-382299f91cbb>\",\"WARC-Concurrent-To\":\"<urn:uuid:2b1a4b61-f4c1-4c01-b65b-f7fcb1005630>\",\"WARC-IP-Address\":\"137.208.57.46\",\"WARC-Target-URI\":\"https://search.r-project.org/CRAN/refmans/aniDom/html/plot_trajectories.html\",\"WARC-Payload-Digest\":\"sha1:NIRZS4T42AYWCXPPVXIIE5ZE2GGKXLQD\",\"WARC-Block-Digest\":\"sha1:INDIKS66APQJEDZCAAI46FTJRQTAUVQW\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964363327.64_warc_CC-MAIN-20211206224536-20211207014536-00534.warc.gz\"}"}