Description Usage Arguments Details Value Examples
Build unique ID for dyads of focal individuals (and neighbours).
1 |
DT |
data.table. |
focal |
focal individual. |
neighbour |
neighbours, optional - see Details. |
both |
if both is TRUE, returns duplicated dyadIDs with all focal/neighbour inverted and appended. |
This function builds a dyad ID: focal A -> neighbour B (and focal B -> neighbour A) = dyad 1.
If neighbour is not provided, all potential dyads are returned as a "dyad dictionary".
Alternatively, when observed neighbours are provided, a "dyadID" column is added to the data.table with the individuals
1 2 3 4 5 6 7 | # Load data.table
library(data.table)
# Read example data
DT <- fread(system.file("extdata", "DT.csv", package = "toast"))
dyadDict <- dyad_id(DT, focal = 'ID', neighbour = NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.