R/expDesign_building.blocks.R
scale_scans.Rd
Written as a S3 method to be applied to scanList
or sLlist
(list of scanList
) objects.
scale_scans(scan.list, ...)
scan.list | a |
---|---|
... | additional arguments to be passed. At the moment At the moment |
a scaled
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 divided by the number of times
they have been sampled (determined via count_nonNA()
). Inherits from
weightedAdj
and the previous scanList
class (theoretical or empirical, inheriting from
scanList
), and keeps track of the scan.list
's list of attributes attrs
set.seed(42) n <- 5L samp.effort <- 241L # Adjacency matrix import ## random directed adjacency matrix Adj <- sample(1:samp.effort,n * n) |> matrix(nrow = 5,dimnames = list(letters[1:n],letters[1:n])) diag(Adj) <- 0L Adj#> a b c d e #> a 0 228 47 165 111 #> b 229 0 24 110 131 #> c 65 122 0 20 41 #> d 153 241 100 0 227 #> e 74 128 89 114 0# social network simulations ## theoretical scans sL <- simunet(Adj = Adj,samp.effort = samp.effort,mode = "directed",n.scans = 120L) sL#> #> scan: 1 #> a . 1 . 1 . #> b 1 . . . . #> c . . . . . #> d . 1 1 . 1 #> e . . 1 . . #> #> scan: 2 #> a . 1 . . . #> b 1 . . 1 . #> c 1 1 . . . #> d . 1 . . 1 #> e . . 1 1 . #> #> ... ( 117 more scans) #> #> scan: 120 #> a . 1 . 1 1 #> b 1 . . 1 . #> c . 1 . . . #> d 1 1 . . 1 #> e . 1 1 . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob#> #> Scaled weighted adjacency matrix #> a . 0.958 0.300 0.525 0.400 #> b 0.933 . 0.092 0.400 0.533 #> c 0.300 0.500 . 0.117 0.142 #> d 0.592 1.000 0.375 . 0.958 #> e 0.242 0.500 0.392 0.450 . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob - summed.scanList - sampled# ... or `scanList` object directly ## group-scan sampling sL |> perform_exp(design_sampling("group",.6)) |> scale_scans()#> #> Scaled weighted adjacency matrix #> a . 0.944 0.258 0.487 0.354 #> b 0.929 . 0.063 0.347 0.493 #> c 0.338 0.422 . 0.121 0.136 #> d 0.667 1.000 0.338 . 0.950 #> e 0.224 0.507 0.408 0.467 . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob - obs.P - theoretical.scanList - summed.scanList - sampled## comparing group-scan and focal sampling sL |> perform_exp(design_sampling("group",.6), design_sampling("focal","even") ) |> scale_scans()#> [[1]] #> #> Scaled weighted adjacency matrix #> a . 0.973 0.387 0.562 0.488 #> b 0.921 . 0.071 0.405 0.464 #> c 0.293 0.431 . 0.110 0.183 #> d 0.580 1.000 0.379 . 0.958 #> e 0.254 0.466 0.395 0.447 . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob - obs.P - theoretical.scanList - summed.scanList - sampled #> #> [[2]] #> #> Scaled weighted adjacency matrix #> a . 0.958 0.354 0.646 0.417 #> b 0.875 . 0.104 0.375 0.438 #> c 0.312 0.521 . 0.146 0.083 #> d 0.604 1.000 0.396 . 1.000 #> e 0.188 0.583 0.333 0.438 . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob - focalList - theoretical.scanList - summed.scanList - sampled #> #> attr(,"class") #> [1] "sLlist"