| igraph.to.gexf | R Documentation |
gexf and igraph classesConverts objects between gexf and igraph objects keeping
attributes, edge weights and colors.
igraph.to.gexf(igraph.obj, ...)
gexf.to.igraph(gexf.obj)
igraph.obj |
An object of class |
... |
Further arguments passed to |
gexf.obj |
An object of class |
If the position argument is not NULL, the new gexf object will
include the position viz-attribute.
For igraph.to.gexf : gexf class object
For gexf.to.igraph : igraph class object
George Vega Yon g.vegayon@gmail.com
layout()
if (interactive()) {
# Running demo
demo(gexfigraph)
}
fn <- system.file("gexf-graphs/lesmiserables.gexf", package = "rgexf")
gexf1 <- read.gexf(fn)
igraph1 <- gexf.to.igraph(gexf1)
gexf2 <- igraph.to.gexf(igraph1)
if (interactive()) {
# Now, let's do it with a layout! (although we can just use
# the one that comes with lesmiserables :))
pos <- igraph::layout_nicely(igraph1)
plot(
igraph.to.gexf(igraph1, nodesVizAtt = list(position=cbind(pos, 0))),
edgeWidthFactor = .01)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.