Matrices can be created from a vector using the matrix(...) function.
Sometimes it is convenient to use the outer product function %o% or the generalized outer product function, outer(...), to create a matrix.
A dataframe can be coerced into a matrix using the function as.matrix(...).