This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
randomMatrix <- function( rows = 1000, cols = NULL, min = 1, max = 100) { | |
# Originally from my Coursera assignment: https://github.com/maptracker/ProgrammingAssignment2/blob/master/cachematrix.R | |
# Returns a rows x cols matrix of random numbers | |
# If columns are not defined, then set them to number of rows: | |
if (is.null(cols)) cols <- rows | |
# Generate random integers to put into the matrix | |
random <- runif( cols * rows, min = min, max = max + 1) | |
NewerOlder