Learn R Programming

robin (version 1.0.0)

prepGraph: prepGraph

Description

This function reads graphs from a file and prepares them for the analysis.

Usage

prepGraph(
  file,
  file.format = c("edgelist", "pajek", "ncol", "lgl", "graphml", "dimacs", "graphdb",
    "gml", "dl", "igraph"),
  numbers = FALSE,
  directed = FALSE,
  header = FALSE
)

Arguments

file

The input file containing the graph.

file.format

Character constant giving the file format. Right now as_edgelist, pajek, graphml, gml, ncol, lgl, dimacs, graphdb and igraph are supported

numbers

A logical value indicating if the names of the nodes are values.This argument is settable for the edgelist format. The default is FALSE.

directed

A logical value indicating if is a directed graph. The default is FALSE.

header

A logical value indicating whether the file contains the names of the variables as its first line.This argument is settable for the edgelist format.The default is FALSE.

Value

An igraph object, which do not contain loop and multiple edges.

Examples

Run this code
# NOT RUN {
my_file <- system.file("example/football.gml", package="robin")
graph <- prepGraph(file=my_file, file.format="gml")
# }

Run the code above in your browser using DataLab