powered by
Generate a random matrix, given a rando function and it's dimensions. By default, this will generate a square matrix.
r_matrix( engine, row_names = NULL, col_names = NULL, ..., nrow = default_n(row_names), ncol = default_n(col_names), .seed = NULL )
The rando function that will be used to generate the random numbers
names to be assigned to the rows or columns. This is also used in deciding the dimensions of the result.
Unused
dimensions of the matrix. The default_n() function will provide a default value within context.
default_n()
One of the following:
NULL (default) will not change the current seed. This is the usual case for generating random numbers.
A numeric value. This will be used to set the seed before generating the random numbers. This seed will be stored with the results.
TRUE. A random seed value will be generated and set as the seed before the results are generated. Again, this will be stored with the results.
To extract the random seed from a previously generated set of values, use pull_seed()
pull_seed()
A matrix with nrow rows and ncol columns an a type as decided by the function passed to engine.
nrow
ncol
engine
# NOT RUN { set_n(5) r_matrix(r_norm) r_matrix(r_unif,min=1,max=2) r_matrix(r_norm,mean=10,sd=2,ncol=2) # }
Run the code above in your browser using DataLab