runifMatrix {omnibus} | R Documentation |
Matrix of random values, possibly with standardization by row or column
Description
This function creates a matrix populated by random uniform values and (at the user's discretion), standardizes the rows, columns, or entire matrix so values sum to 1.
Usage
runifMatrix(nrow, ncol, min = 0, max = 1, stand = NULL)
Arguments
nrow , ncol |
Number of rows and columns. |
min , max |
Minimum and maximum value of values. |
stand |
Any of:
Partial matching is used and case is ignored. |
Value
A numeric matrix.
Examples
rows <- 4
cols <- 3
runifMatrix(rows, cols)
standByRows <- runifMatrix(rows, cols, stand = 'r')
standByRows
rowSums(standByRows)
standByCols <- runifMatrix(rows, cols, stand = 'c')
standByCols
colSums(standByCols)
standByMe <- runifMatrix(rows, cols, stand = 'm')
standByMe
sum(standByMe) # whenever you're in trouble
[Package omnibus version 1.2.15 Index]