NLGetGraph {RNetLogo} | R Documentation |
Captures a network.
Description
NLGetGraph
converts a set of NetLogo Link agents into an igraph graph object (see package igraph for details on graph objects).
Usage
NLGetGraph(link.agentset="links", nl.obj=NULL)
Arguments
link.agentset |
(optional) A string defining an agentset of NetLogo Links. Default is |
nl.obj |
(optional) A string identifying a reference to a NetLogo instance created with |
Details
Saves a link network in a graph object of package igraph for network analysis.
Value
Returns a graph object of package igraph.
Author(s)
Jan C. Thiele <rnetlogo@gmx.de>
See Also
Examples
## Not run:
nl.path <- "C:/Program Files/NetLogo 6.0/app"
NLStart(nl.path)
model.path <-
"/models/Sample Models/Networks/Preferential Attachment.nlogo"
NLLoadModel(paste(nl.path,model.path,sep=""))
NLCommand("setup")
NLDoCommand(4, "go")
graph1 <- NLGetGraph()
plot(graph1, layout=layout.kamada.kawai, vertex.label=V(graph1)$name,
vertex.shape="rectangle", vertex.size=20, asp=FALSE)
## End(Not run)
[Package RNetLogo version 1.0-4 Index]