Learn R Programming

netdiffuseR (version 1.16.7)

diffnet_to_igraph: Convertion between graph classes

Description

Convertion between graph classes

Usage

diffnet_to_igraph(graph, slices = 1:nslices(graph))
igraph_to_diffnet(graph, toavar, t0 = NULL, t1 = NULL)

Arguments

graph
A diffnet class object.
slices
An integer vector indicating the slices to subset.
toavar
Character scalar. Name of the attribute that holds the times of adoption.
t0
Integer scalar. Passed to as_diffnet.
t1
Integer scalar. Passed to as_diffnet.

Value

A list of length(slices) igraph objects.

Examples

Run this code
# Reading the meddical innovation data into igraph --------------------------
x <- diffnet_to_igraph(medInnovationsDiffNet)

# Fetching the times of adoption
igraph::vertex_attr(x[[1]], "toa")

Run the code above in your browser using DataLab