View source: R/perm.double.focal.R
perm.double.focal | R Documentation |
Warning, the original function (Farine 2017) uses a control factor, the number of focals and the ids of the focals.
perm.double.focal( obs, ego, alters, focal, nperm, progress = FALSE, index = "sri", measure, test = "median", df = NULL, dfid = NULL, rf, ... )
obs |
a data frame of focal observations. |
ego |
an integer indicating the column of the focal id for the obs. |
alters |
an integer indicating the column of focal's alters in obs. |
focal |
a numeric vector indicating the focal number in obs. |
nperm |
an integer indicating the number of permutations to performed. |
progress |
a boolean indicating if the permutation process must be visible. |
index |
Which type of index of associations to calculate:
|
measure |
a character indicating the social network measure to compute (Only those available in ANTs) |
test |
a character indicating the test to realize to account for the social network measure |
df |
a data frame of individual characteristics in which store permutations. |
dfid |
an integer or a string indicating the column with individual ids in argument df. |
rf |
an integer (column id) or a string (column name) indicating the column holding the factor grouping multiple networks in argument df. |
... |
Additional arguments related to the social network measure to compute (argument measure). |
Pre-network permutation for focal sampling data, and for symmetric behaviour only.
Farine, D. R. (2017). A guide to null models for animal social network analysis. Methods in ecology and evolution, 8(10), 1309-1320.
Sosa, S. (2018). Social Network Analysis, in: Encyclopedia of Animal Cognition and Behavior. Springer.
# Single network without data frame--------------------- head(sim.focal.undirected) t=perm.double.focal(obs = sim.focal.undirected, ego = 3, alters = 4, focal = 1, nperm = 10, progress = FALSE, measure = "met.strength") # Multiple networks with data frames--------------------- d1 = data.frame("id" = names(t[[1]]), "period" = 1) d2 = data.frame("id" = names(t[[1]]), "period" = 2) t = list(d1, d2) obs = list(sim.focal.undirected, sim.focal.undirected) t =perm.double.focal(obs = obs, ego = 3, alters = 4, focal = 1, nperm = 10, measure = "met.strength", df = t, dfid = "id", rf = "period")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.