random_sparse_matrix: Random Sparse Matrix

Description Usage Arguments Value Author(s) References Examples

Description

Random Sparse Matrix

Usage

1
2
random_sparse_matrix(nrow, ncol, nnz, rfunc = rnorm, rand.x = function(n)
  round(rfunc(nnz), 2), ...)

Arguments

nrow

number of rows in matrix

ncol

number of cols in matrix

nnz

number of non-zero entries

rfunc

random function to use to generate the non-zero entries

rand.x

random number generator for 'x' slot

...

optionally further arguments passed to sparseMatrix()

Value

a sparseMatrix of dimension (nrow, ncol)

Author(s)

Martin Maechler, Zach Mayer

References

Examples

1
2
M1 <- random_sparse_matrix(1000, 20, nnz = 200)
summary(M1)

zachmayer/rbm documentation built on May 4, 2019, 9:07 p.m.