convert_network: Convert between supported network representations

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

convert_networkR Documentation

Convert between supported network representations

Description

This is the central object-to-object conversion interface. Use import_network() for files and tabular edge data, and read_network() for graph file formats handled by igraph, and export_network() to write third-party graph formats.

Usage

convert_network(
  from,
  to = c("igraph", "sparse", "legacy"),
  case_sensitive = FALSE
)

Arguments

from

An igraph object, sparse matrix, indexed sparse network, or legacy NEArender network.

to

Output representation: "igraph", "sparse", or "legacy".

case_sensitive

Preserve identifier case.

Value

A normalized network in the requested representation.

See Also

as_igraph_network(), as_sparse_network(), as_nearender_network(), import_network(), read_network(), export_network()

Examples

graph <- import_network(data.frame(from = "A", to = "B"),
  species = NULL, input_id_format = "custom", verbose = FALSE)
sparse <- convert_network(graph, "sparse")
legacy <- convert_network(sparse, "legacy")
legacy$links

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