Use this if you are using igraph from R
read_graph {igraph} | R Documentation |
The read_graph
function is able to read graphs in various
representations from a file, or from a http connection. Various formats
are supported.
read_graph(
file,
format = c("edgelist", "pajek", "ncol", "lgl", "graphml", "dimacs", "graphdb", "gml",
"dl"),
...
)
file |
The connection to read from. This can be a local file, or a
|
format |
Character constant giving the file format. Right now
|
... |
Additional arguments, see below. |
The read_graph
function may have additional arguments depending on
the file format (the format
argument). See the details separately for
each file format, below.
A graph object.
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.
Additional arguments:
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).
Logical scalar, whether to create a directed graph. The
default value is TRUE
.
Gabor Csardi csardi.gabor@gmail.com