Skip to contents

This function saves a single graph or list of graphs to a specified location on the file system in a specified format.

Usage

save_graphs(graph, file_path, filetype = ".gml", format)

Arguments

graph

Either a single igraph graph, or a list of igraph graphs.

file_path

The Absolute path to save the graph/s to.

filetype

The filetype extension to append to the graph file name, e.g. ".gml"

format

Formats supported by igraph::read_graph.

Value

A list of graphs in igraph format.

Examples

if (FALSE) { # \dontrun{
library(igraph)
sample_graph  <- igraph::graph_from_literal(A-B, B-C)
path <- "/path/to/save/to/"
save_graphs(sample_graph, path, ".gml", "gml")
} # }