Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

write_graph

Writing the graph to a file in some format


Description

write_graph is a general function for exporting graphs to foreign file formats, however not many formats are implemented right now.

Usage

write_graph(
  graph,
  file,
  format = c("edgelist", "pajek", "ncol", "lgl", "graphml", "dimacs", "gml", "dot",
    "leda"),
  ...
)

Arguments

graph

The graph to export.

file

A connection or a string giving the file name to write the graph to.

format

Character string giving the file format. Right now pajek, graphml, dot, gml, edgelist, lgl, ncol and dimacs are implemented. As of igraph 0.4 this argument is case insensitive.

...

Other, format specific arguments, see below.

Value

A NULL, invisibly.

Edge list format

The edgelist format is a simple text file, with one edge in a line, the two vertex ids separated by a space character. The file is sorted by the first and the second column. This format has no additional arguments.

Author(s)

References

Adai AT, Date SV, Wieland S, Marcotte EM. LGL: creating a map of protein function with an algorithm for visualizing very large biological networks. J Mol Biol. 2004 Jun 25;340(1):179-90.

See Also

Examples

g <- make_ring(10)
## Not run: write_graph(g, "/tmp/g.txt", "edgelist")

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.