EVOLUTION-MANAGER
Edit File: read_graph.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Reading foreign file formats</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for read_graph {igraph}"><tr><td>read_graph {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Reading foreign file formats</h2> <h3>Description</h3> <p>The <code>read_graph</code> function is able to read graphs in various representations from a file, or from a http connection. Various formats are supported. </p> <h3>Usage</h3> <pre> read_graph( file, format = c("edgelist", "pajek", "ncol", "lgl", "graphml", "dimacs", "graphdb", "gml", "dl"), ... ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>file</code></td> <td> <p>The connection to read from. This can be a local file, or a <code>http</code> or <code>ftp</code> connection. It can also be a character string with the file name or URI.</p> </td></tr> <tr valign="top"><td><code>format</code></td> <td> <p>Character constant giving the file format. Right now <code>edgelist</code>, <code>pajek</code>, <code>ncol</code>, <code>lgl</code>, <code>graphml</code>, <code>dimacs</code>, <code>graphdb</code>, <code>gml</code> and <code>dl</code> are supported, the default is <code>edgelist</code>. As of igraph 0.4 this argument is case insensitive.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional arguments, see below.</p> </td></tr> </table> <h3>Details</h3> <p>The <code>read_graph</code> function may have additional arguments depending on the file format (the <code>format</code> argument). See the details separately for each file format, below. </p> <h3>Value</h3> <p>A graph object. </p> <h3>Edge list format</h3> <p>This format is a simple text file with numeric vertex ids defining the edges. There is no need to have newline characters between the edges, a simple space will also do. </p> <p>Additional arguments: </p> <dl> <dt>n</dt><dd><p>The number of vertices in the graph. If it is smaller than or equal to the largest integer in the file, then it is ignored; so it is safe to set it to zero (the default).</p> </dd> <dt>directed</dt><dd><p>Logical scalar, whether to create a directed graph. The default value is <code>TRUE</code>.</p> </dd> </dl> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>See Also</h3> <p><code><a href="write_graph.html">write_graph</a></code> </p> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>