random.Rd
Creates random spam matrix given the dimension and other parameters.
spam_random(nrow = 1L, ncol = nrow, density = 0.5, distribution = NULL, digits = NULL,
sym = FALSE, spd = FALSE, verbose = FALSE, ...)
integer value for the number of rows for the spam
matrix to create.
integer value for the number of columns. The default value is the same as nrow
.
A numeric value between 0 and 1 specifying the approximate density of matrix.
If equal to zero the spam
matrix contains only zeros and if equal to 1 the spam
matrix is full.
a random number generating distribution function to sample the entries of the spam
matrix.
The function must have an argument with the name n
, possible candidates are rnorm
, rexp
, rpois
, rweibull
, etc..
possible additional arguments for the distribution function if specified with distribution
.
an integer value for the number of digits the entries should be rounded.
logical value to specify symmetry of the spam
matrix.
logical value to specify positive definitness of the spam
matrix, via diagonal dominace criteria.
Note, if spd
TRUE, then sym
is overwritten to TRUE
in any case.
logical value to specify verbose statments of the function.
A random matrix in spam
format.
To create a random spam64 matrix, set options(spam.force64 = TRUE)
.
set.seed(42)
rspam <- spam_random(500, digits = 2, distribution = rnorm, sd = 2, mean = 10, density = .01)
display.spam(rspam, cex = 2)