Description Usage Arguments Value Examples
View source: R/scanList_tools.R
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
1 |
scan.list |
a |
a |
character (scalar or vector), the name(s) of the attribute(s) to retrieve, modify or add |
the attribute(s) requested, or the scan.list
which attrs
attribute has been modified
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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
sL <- simunet(Adj = Adj,samp.effort = samp.effort,mode = "upper",n.scans = 120L)
# retrieve all attributes in `attrs`
sL |> attrs()
# retrieve a specific attribute from `attrs`
sL |> attrs("edge.Prob")
# modify a specific attribute from `attrs` (internal use)
attrs(sL,"scanList.type") <- "empirical"
attrs(sL,"scanList.type")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.