Learn R Programming

NetSim (version 0.9)

package-integration: Functions to transform NetSim objects to objects of other network classes

Description

Functions to transform NetSim objects to objects of other network classes. So far, a transformation function to igraph objects is implemented

Usage

"as.igraph"(x, mode=c("directed", "undirected"), ...)

Arguments

x
A Netsim network object
mode
Character scalar, specifies whether igraph should interpret the graph as directed or undirected. More options are not supported, yet.
...
Additional arguments

References

Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.sf.net

Examples

Run this code
	nActors <- 4
	network <- create_network(matrix(0, nActors, nActors))

	# set ties
	set_tie(network, i = 0, j = 1, value = 1)
	set_tie(network, i = 0, j = 2, value = 1)
	
	## Not run: library(igraph)
	## Not run: myIGraph <- as.igraph(network, mode = "directed")
	## Not run: plot(myIgraph) # now using the igraph package

Run the code above in your browser using DataLab