export_network: Export a network through igraph

View source: R/data-access-io-prepare.R

export_networkR Documentation

Export a network through igraph

Description

GraphML and GML are recommended when edge weights or other attributes must be retained. Simpler edge-list formats may discard attributes.

Usage

export_network(
  network,
  path,
  format = c("graphml", "gml", "ncol", "lgl", "pajek", "edgelist"),
  case_sensitive = TRUE,
  ...
)

Arguments

network

An igraph, legacy NEArender, or indexed sparse NEArender network graph.

path

Output graph file.

format

A format passed to the igraph writer.

case_sensitive

Preserve identifier case during conversion. When this argument is omitted for a normalized object, its recorded case policy is retained.

...

Additional arguments passed to igraph::write_graph().

Value

path, invisibly.

See Also

read_network(), import_network(), convert_network()

Examples

graph <- import_network(data.frame(from = "A", to = "B"),
  species = NULL, input_id_format = "custom", verbose = FALSE)
path <- tempfile(fileext = ".graphml")
export_network(graph, path)
file.exists(path)
unlink(path)

NEArender documentation built on Nov. 28, 2026, 5:10 p.m.