Convenience function to back-transform a matList object (list of matrices) into a scanList object

matList2scanList(mat.list)

Arguments

mat.list

a 3 dimensional array representing adjacency matrices (first 2 dimensions) throughout the different scans (3rd dimension)

Value

scanList object. See simunet()

Examples

set.seed(42) n <- 5L samp.effort <- 100L # 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])) Adj[lower.tri(Adj,diag = TRUE)] <- 0L Adj
#> a b c d e #> a 0 100 37 27 58 #> b 0 0 20 36 42 #> c 0 0 0 5 93 #> d 0 0 0 0 30 #> e 0 0 0 0 0
sL <- simunet(Adj,samp.effort,"upper",10) mL <- sL |> scanList2matList() mL
#> [[1]] #> #> scan: #> a . 1 1 . 1 #> b . . . . . #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[2]] #> #> scan: #> a . 1 . . . #> b . . . . 1 #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[3]] #> #> scan: #> a . 1 . . . #> b . . . . 1 #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[4]] #> #> scan: #> a . 1 1 . 1 #> b . . . . 1 #> c . . . . . #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[5]] #> #> scan: #> a . 1 . . 1 #> b . . . 1 . #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[6]] #> #> scan: #> a . 1 1 . 1 #> b . . 1 . 1 #> c . . . . 1 #> d . . . . 1 #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[7]] #> #> scan: #> a . 1 . 1 . #> b . . . 1 1 #> c . . . . 1 #> d . . . . 1 #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[8]] #> #> scan: #> a . 1 1 . . #> b . . . . 1 #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[9]] #> #> scan: #> a . 1 . . 1 #> b . . . . 1 #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> [[10]] #> #> scan: #> a . 1 . 1 1 #> b . . . . . #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob #> #> attr(,"class") #> [1] "theoretical" "matList" #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob
mL |> matList2scanList()
#> #> scan: 1 #> a . 1 1 . 1 #> b . . . . . #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> scan: 2 #> a . 1 . . . #> b . . . . 1 #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> ... ( 7 more scans) #> #> scan: 10 #> a . 1 . 1 1 #> b . . . . . #> c . . . . 1 #> d . . . . . #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob
identical(mL |> matList2scanList(),sL)
#> [1] TRUE