Convenience function to back-transform a igraphSN
object (igraph
object with attrs
) into a
scanList
object
igraph2scanList(G, format = c("weightedAdj", "scanList"))
G | an |
---|---|
format | character, option to specify if a |
scanList object. See simunet()
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#> IGRAPH c015008 UNW- 5 9 -- #> + attr: name (v/c), weight (e/n) #> + edges from c015008 (vertex names): #> [1] a--b a--c a--d a--e b--c b--d b--e c--e d--e #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob - summed.scanList - sampled - original.classG |> igraph2scanList()#> #> Weighted adjacency matrix #> a . 10 4 2 6 #> b . . 1 2 7 #> c . . . . 9 #> d . . . . 2 #> e . . . . . #> #> #> Hidden attributes: #> scanList.type - raw.scanList - Adj - samp.effort - n.scans - mode #> Adj.subfun - edge.Prob - summed.scanList - sampledG |> igraph2scanList(format = "scanList")#> #> 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#> [1] TRUE