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
Run the code above in your browser using DataLab