View source: R/expand.gridMatrix.R
expand.gridMatrix | R Documentation |
This function is similar to expand.grid()
, in the sense that it returns a
matrix that has 2 columns, one for each input, and one row per combination, cycling through the first field first.
It differs from expand.grid in that this returns a matrix not data.frame, only accepts two parameters creating two columns, for now,
and lacks the other parameters of expand.grid
expand.gridMatrix(x, y)
x |
required vector |
y |
required vector |
This function returns a matrix and tries to assign colnames based on the two input parameters. If they are variables, it uses those names as colnames. Otherwise it uses "x" and "y" as colnames.
expand.grid()
expand.gridMatrix(99:103, 1:2)
zz <- 1:10; top <- 1:2
expand.gridMatrix(zz, top)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.