igraph.to.gexf: Converting between 'gexf' and 'igraph' classes

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/igraph.R

Description

Converts objects between gexf and igraph objects keeping attributes, edge weights and colors.

Usage

1
2
3
igraph.to.gexf(igraph.obj, ...)

gexf.to.igraph(gexf.obj)

Arguments

igraph.obj

An object of class igraph.

...

Further arguments passed to gexf().

gexf.obj

An object of class gexf.

Details

If the position argument is not NULL, the new gexf object will include the position viz-attribute.

Value

Author(s)

George Vega Yon g.vegayon@gmail.com

See Also

layout()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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)
 }

gvegayon/rgexf documentation built on Oct. 25, 2021, 4:21 p.m.