##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(nrow, ncol, dist=runif, ...){
# check that 'dist' is a function.
if( !is.function(dist) )
stop("NMF::rmatrix - invalid value for argument 'dist': must be a function [class(dist)='", class(dist), "'].")
# build the random matrix using the distribution function
matrix(dist(nrow*ncol, ...), nrow, ncol)
}
Run the code above in your browser using DataLab