Learn R Programming

netdiffuseR (version 1.22.6)

igraph: Coercion between graph classes

Description

Coercion between graph classes

Usage

diffnet_to_igraph(graph, slices = 1:nslices(graph))

igraph_to_diffnet( graph = NULL, graph.list = NULL, toavar, t0 = NULL, t1 = NULL, ... )

Value

Either a list of length(slices)

igraph

(diffnet_to_igraph), or a diffnet object (igraph_to_diffnet) objects.

Arguments

graph

Either a diffnet or igraph graph object.

slices

An integer vector indicating the slices to subset.

graph.list

A list of igraph objects.

toavar

Character scalar. Name of the attribute that holds the times of adoption.

t0

Integer scalar. Passed to new_diffnet.

t1

Integer scalar. Passed to new_diffnet.

...

Further arguments passed to as_diffnet.

See Also

Other Foreign: network, read_pajek(), read_ucinet_head()

Examples

Run this code
# 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")

Run the code above in your browser using DataLab