as_adjmat: An alternative to 'as.matrix' to retrieve adjacency matrix...

View source: R/utils.R

as_adjmatR Documentation

An alternative to as.matrix to retrieve adjacency matrix fast

Description

This function does not perform significant checks. Furthermore, this function won't keep the row/col names.

Usage

as_adjmat(x)

Arguments

x

An object to be coerced as an adjacency matrix.

Examples


set.seed(1231)
x <- matrix_to_network(rbernoulli(rep(5, 100)))
benchmarkito(
  as_adjmat = as_adjmat(x),
  as.matrix = lapply(x, as.matrix)
)

ergmito documentation built on July 9, 2023, 7:09 p.m.