expand.gridMatrix: Similar to expand.grid, but returns a matrix not data.frame

View source: R/expand.gridMatrix.R

expand.gridMatrixR Documentation

Similar to expand.grid, but returns a matrix not data.frame

Description

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

Usage

expand.gridMatrix(x, y)

Arguments

x

required vector

y

required vector

Value

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.

See Also

expand.grid()

Examples

 expand.gridMatrix(99:103, 1:2) 
 zz <- 1:10; top <- 1:2
 expand.gridMatrix(zz, top) 

ejanalysis/analyze.stuff documentation built on April 2, 2024, 10:10 a.m.