sum_scans: Sum list of binary scans into a weighted adjacency matrix...

Description Usage Arguments Value See Also Examples

View source: R/expDesign_building.blocks.R

Description

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.

Usage

1
sum_scans(scan.list, ...)

Arguments

scan.list

a scanList or sLlist object. See objects returned by simunet()

...

additional arguments to be passed.

sum_scans() can use argument:

  • which: character scalar, either:

    • "auto": determine automatically which scanList to sum

    • "theoretical": sum the theoretical.scanList (useful in the case of empirical scanLists)

    • "raw": sum the raw.scanList (useful to see the impact of chosen mode)

Value

a weightedAdj object, or list of such, consisting mainly on a weighted adjacency matrix where each edge weight is equal to the sum of all binary edges. Inherits from the previous scanList class (theoretical or empirical, inheriting from scanList), and keeps track of the scan.list's list of attributes attrs.

Also adds these attributes to attrs:

See Also

simunet(), design_exp(), perform_exp().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set.seed(42)
n <- 5L
samp.effort <- 241L

# Adjacency matrix import
## random directed adjacency matrix
Adj <- matrix(sample(1:samp.effort,n * n),nrow = 5,dimnames = list(letters[1:n],letters[1:n]))
diag(Adj) <- 0L
Adj

# social network simulations
## theoretical scans
sL <- simunet(Adj = Adj,samp.effort = samp.effort,mode = "directed",n.scans = 120L)
sL
sL |> sum_scans()

## group-scan sampling
sL |> perform_exp(design_sampling("group",.6)) |> sum_scans()

## comparing group-scan and focal sampling
sL |> perform_exp(design_sampling("group",.6),
                  design_sampling("focal","even")
                  ) |> sum_scans()

R-KenK/SimuNet documentation built on Oct. 22, 2021, 1:27 a.m.