datagen | R Documentation |
generate random social interaction data
datagen( no = 50, ni = 5, beh = c("appr", "gro", "supp", "prox"), behw = c(0.2, 0.3, 0.1, 0.4), behdur = c(F, T, F, T), biaswithin = 1, friendprop = 0.1, nadd = 0, presence = NULL )
no |
number of interactions to be created |
ni |
number of individuals |
beh |
character, |
behw |
numeric, weights of occurences of behaviours in |
behdur |
logical, whether behaviours have durations |
biaswithin |
bias parameter WTIHIN dyads: if 1: roughly 66% of directionality (biased towards the ID that comes first in alphabet); if 0: no bias, i.e. 50% bias |
friendprop |
proportion of dyads with preferential (more frequent/longer) interactions |
nadd |
numeric, additional number of non-focal IDs |
presence |
numeric of length = 2, (1) proportion of IDs affected by absence, (2) proportion of days (relative to date range) for absence |
The process of inventing interactions within these functions starts with creating a data collection protocol. This protocol is modelled on focal animal sampling, in which the ni
individuals serve as focal animals, and it ends up with a list of "protocols" for a given focal ID on several dates associated with pseudo-randomized observation time (i.e. protocol duration). See examples...
The argument friendprop
introduces higher rates or longer durations of interaction in this proportion of dyads as compared to other dyads. So far, this applies only to focal-focal dyads and won't introduce focal-nonfocal "friends" even if nadd
is not zero.
list with six items: (1) data.frame with interaction data, (2) data.frame with observation time data, (3) data.frame with presence data, (4) character with "friend" dyads, (5) character with focal individuals, (6) non-focal individuals
x <- datagen(no=20, ni=3) # observation time table x$ot # interactions x$dataseq
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.