runifMatrix | R Documentation |
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.
runifMatrix(nrow, ncol, min = 0, max = 1, stand = NULL)
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. |
A numeric matrix.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.