Main Functions

Running simulations and experiments

simunet()

Perform social network simulations

design_exp()

Design experiment to perform on theoretical scanList

perform_exp()

Perform an experimental design on theoretical scanList

design_sampling()

Design a sampling regime to perform on a theoretical scanList

Building Blocks

Provided experimental manipulations - combine them with your own!

add_scans()

Perform additional scans and add them to the scanList New scans rely on edge probability matrix previously drawn from beta distributions. This can be used to compare sampling regime when it is expected that one will sample edges less in a predictable fashion (e.g. group-scan vs focal sampling)

count_nonNA()

Count number of times edges have not been observed For empirical scanList, an edge that is observed during a scan is not NA (it will be either 0 or 1). This function counts how many time this was the case in the inputted scan.list for each edge.

remove_mostCentral()

Remove from all scans the (overall) most central individual Individual centrality based on eigen vectors. Mostly given as an example of experimental manipulations that could be performed on scanList as expDesign, even as user-defined functions

remove_mostPeripheral()

Remove from all scans the (overall) most peripheral individual Individual centrality based on eigen vectors. Mostly given as an example of experimental manipulations that could be performed on scanList as expDesign, even as user-defined functions

scale_scans()

Scale list of binary scans into a weighted adjacency matrix Scaling here is dividing by the sum of 1s by the number of time an edge has been observed (whether it was 0 or 1).

sum_scans()

Sum list of binary scans into a weighted adjacency matrix Written as a S3 method to be applied to scanList or sLlist (list of scanList) objects.

ASNR Import

Import social networks from ASNR

asnr_network_df()

Generate a data frame of all networks in the Animal Social Network Repository (asnr)

import_from_asnr()

Import network from asnr package Bansal lab's Animal Social Network Repository

Interact with some specificities of SimuNet classes of objects

attrs()

scanList's attrs attributes related convenience functions: retrieve or modify attributes attrs() and attrs()<- can be used to retrieve the named attributes contained in the attributes list attrs of a scanList object

scanList2matList()

Convert scanList 3D array into list of 2D matrices

matList2scanList()

Convert matList into scanList objects

scanList2igraph()

Convert scanList 3D array into igraph object (with attrs)

igraph2scanList()

Convert igraphSN into scanList objects

weightedAdj2scanList()

Convert weightedAdj into 3D binary array scanList objects Back-transform weightedAdjinto the scanList it was summed from (see sum_scans())

sLapply()

Shortcut to a lapply equivalent to apply a function to each 2D matrix contained in a scanList Written analogously to vapply(). Values returned by .f should be a similarly dimensionned matrix as the first one contained in the 3D array

sLlapply()

Shortcut to a lapply equivalent to apply a function to a list of scanList: a sLlist object Written analogously to lapply()

sLvapply()

Shortcut to a lapply equivalent to apply a function to each 2D matrix contained in a scanList Written analogously to vapply(). Values returned by .f should be a similarly dimensionned matrix as the first one contained in the 3D array

Internals

Internal functions and helpers

`attrs<-`()

scanList's attrs attributes related convenience functions: retrieve or modify attributes attrs() and attrs()<- can be used to retrieve the named attributes contained in the attributes list attrs of a scanList object

diagonal()

Diagonal Part of a Matrix

draw_edgeProb()

Draw edge presence probability matrix from posterior Beta distribution (Internal use)

`non.diagonal<-`()

Reassign values in the non diagonal part of a matrix similar use as its diag(x) and diag(x) <- value equivalent

non.diagonal()

Non Diagonal Part of a Matrix

quick_sample()

Quick optimized equivalent to sample(x,size,replace=TRUE)