prepGraph: prepGraph

View source: R/ROBIN.R

prepGraphR Documentation

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,
  verbose = FALSE
)

Arguments

file

The input file containing the graph.

file.format

Character constant giving the file format. 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

verbose

flag for verbose output (default as FALSE). for the edgelist format.The default is FALSE.

Value

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

Examples

#install.packages("robin")

#If there are problems with the installation try:
# if (!requireNamespace("BiocManager", quietly = TRUE))
#     install.packages("BiocManager")
# BiocManager::install("gprege")
# install.packages("robin")   
                     
my_file <- system.file("example/football.gml", package="robin")
graph <- prepGraph(file=my_file, file.format="gml")

robin documentation built on May 17, 2022, 1:07 a.m.