Coercion between graph classes
diffnet_to_igraph(graph, slices = 1:nslices(graph)) igraph_to_diffnet( graph = NULL, graph.list = NULL, toavar, t0 = NULL, t1 = NULL, ... )
graph | |
---|---|
slices | An integer vector indicating the slices to subset. |
graph.list | A list of |
toavar | Character scalar. Name of the attribute that holds the times of adoption. |
t0 | Integer scalar. Passed to |
t1 | Integer scalar. Passed to |
... | Further arguments passed to |
Either a list of length(slices)
igraph
(diffnet_to_igraph
), or a diffnet
object (igraph_to_diffnet
)
objects.
Other Foreign:
network
,
read_pajek()
,
read_ucinet_head()
# Reading the medical innovation data into igraph -------------------------- x <- diffnet_to_igraph(medInnovationsDiffNet[,,1:4]) # Fetching the times of adoption igraph::vertex_attr(x[[1]], "toa")#> [1] 1 4 4 4 4 4 4 3 4 2 4 4 2 4 4 4 4 4 4 2 4 4 4 4 3 4 1 4 3 4 4 4 4 4 4 4 4 #> [38] 4 4 4 4 4 4 4 1 4 4 1 4 4 4 4 4 4 1 2 4 4 4 3 4 4 1 4 4 1 4 4 4 1 2 4 1 1 #> [75] 2 2 4 4 4 4 1 4 4 4 4 4 2 4 4 4 4 4 4 4 3 4 4 4 4 4 4 3 4 4 4 3 2 4 4 4 4 #> [112] 4 4 3 4 4 4 3 4 4 4 4 4 4 4