Description Usage Arguments Details Value Author(s) See Also Examples
NLGetGraph
converts a set of NetLogo Link agents into an igraph graph object (see package igraph for details on graph objects).
1 | NLGetGraph(link.agentset="links", nl.obj=NULL)
|
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 |
Saves a link network in a graph object of package igraph for network analysis.
Returns a graph object of package igraph.
Jan C. Thiele <rnetlogo@gmx.de>
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.