sim_adjacency: Adjacency matrix simulation

Description Usage Arguments Value Examples

View source: R/sim_adjacency.R

Description

sim_adjacency creates a randomly generated adjacency matrix

Usage

1
sim_adjacency(n, mode = "undirected", weight = NULL)

Arguments

n

Positive integer, number of nodes in the network

mode

A character string, indicating directedness of the matrix. Default is "undirected", where edges do not have direction (therefore adjacency matrix symmetric)

weight

A length-2 vector of non-negative integers, specifying the range edge weights. Default is NULL, indicating unweighted edges.

Value

Returns an n x n adjacency matrix A.mat

Examples

1
2
sim_adjacency(10, mode = "undirected")  # symmetric; all edge weights 1
sim_adjacency(10, mode = "directed", weight = c(10, 20))

lwa19/centrality documentation built on Dec. 21, 2021, 12:45 p.m.