as_sparse_network: Convert a network to the NEArender sparse representation

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

as_sparse_networkR Documentation

Convert a network to the NEArender sparse representation

Description

The returned object stores binary topology in adjacency and, when available, edge weights in a separate weights sparse matrix. Keeping these matrices separate prevents source edge scores from silently becoming transition probabilities in graph-based calculations.

Usage

as_sparse_network(network, case_sensitive = FALSE)

Arguments

network

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

case_sensitive

Preserve identifier case.

Value

A nearender_sparse_network object.

See Also

as_igraph_network(), as_nearender_network(), convert_network()

Examples

graph <- import_network(data.frame(from = "A", to = "B", score = 2),
  score_column = "score", species = NULL, input_id_format = "custom",
  verbose = FALSE)
sparse <- as_sparse_network(graph)
sparse$adjacency
sparse$weights

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