Like mat, bmat creates a matrix from the given set of values.
These values, however, must be represented by a character string.
Usage
bmat(x, rows = TRUE, sep = ",", ...)
Arguments
x
A data vector, character string, or a list.
rows
Logical. If TRUE (the default) the matrix is filled by rows,
otherwise the matrix is filled by columns.
sep
Separator string. Values within each row/column of x are
separated by this string. Default is ",".
...
Aditional optional arguments.
Details
Be careful when using R functions within character strings in the
call to bmat. The character string is split according to ';' and then
','. For example, mat('rnorm(10)') will work, but
mat('rnorm(10, mean = 3)') will result in an error. A work around
would be to use mat('3 + rnorm(10, mean = 3)').