Rev 27813 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{expand.grid}\title{Create a Data Frame from All Combinations of Factors}\usage{expand.grid(\dots)}\alias{expand.grid}\arguments{\item{\dots}{Vectors, factors or a list containing these. }}\description{Create a data frame from all combinations of the supplied vectors orfactors. See the description of the return value for precise details ofthe way this is done.}\value{A data frame containing one row for each combination of the suppliedfactors. The first factors vary fastest. The columns are labelled bythe factors if these are supplied as named arguments or namedcomponents of a list.Attribute \code{"out.attrs"} is a list which gives the dimension anddimnames for use by \code{\link[stats]{predict}} methods.}\references{Chambers, J. M. and Hastie, T. J. (1992)\emph{Statistical Models in S.}Wadsworth \& Brooks/Cole.}\examples{expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50),sex = c("Male","Female"))}\keyword{models}\keyword{array}