random_sparse_matrix: Build a random sparse matrix

View source: R/utils.R

random_sparse_matrixR Documentation

Build a random sparse matrix

Description

Build a sparse matrix of size m * n with non-zero probability p. Edge weights can be unweighted, constant-weighted or Poisson-weighted.

Usage

random_sparse_matrix(m, n, p, sample_weight_type = "constant", w = 1)

Arguments

m, n

Dimension of matrix to build is (m, n).

p

Probability that each entry is non-zero (before weighting).

sample_weight_type

Type of weighting scheme.

w

Weight parameter.

Value

A random sparse matrix.


motifcluster documentation built on Nov. 18, 2022, 9:06 a.m.