
Rust-based ForceAtlas2 on a pre-computed graph
forceatlas2_from_graph.RdLays out any undirected graph with ForceAtlas2, for example an
SNN graph or a graph from another package. Edge weights come from the
weight edge attribute; without one, every edge weighs 1. Self-loops are
dropped. Only the optimisation parameters in fa2_params are used; the
graph and initialisation ones do not apply here.
Usage
forceatlas2_from_graph(
graph,
init = NULL,
fa2_params = params_fa2(),
seed = 42L,
use_high_precision = NULL,
.verbose = TRUE
)Arguments
- graph
An undirected
igraphobject without multi-edges. Useigraph::as_undirected(mode = "collapse")origraph::simplify()to get there. If present, theweightedge attribute needs to be finite and non-negative.- init
Optional numerical matrix of dimensions
vcount(graph) x 2. The initial layout, e.g. a UMAP of the same samples. IfNULL, a random layout is used. Defaults toNULL.- fa2_params
Named list. ForceAtlas2 parameters, see
params_fa2().- seed
Integer. Random seed for reproducibility. Defaults to
42L.- use_high_precision
Optional boolean. Gives fine-grained control over
fp32vsfp64usage.- .verbose
Logical. Controls verbosity. Defaults to
TRUE.