% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/expand.grid1.R
\name{expand.grid1}
\alias{expand.grid1}
\title{expand.grid with rev and colnames option}
\usage{
expand.grid1(
  ...,
  rev = 1,
  colnames = 0,
  KEEP.OUT.ATTRS = TRUE,
  stringsAsFactors = FALSE
)
}
\arguments{
\item{...}{vectors, factors or a list containing these.}

\item{rev}{= 1 to make the last elements of ... chage first.}

\item{colnames}{= 1 to use  ... as the column names.}

\item{KEEP.OUT.ATTRS}{a logical indicating the "out.attrs" attribute (see below) should be
computed and returned.}

\item{stringsAsFactors}{logical specifying if character vectors are converted to factors.}
}
\value{
A data frame.
}
\description{
expand.grid with rev and colnames option
}
\details{
See comments of native expand.grid.\cr
  Compare \code{expand.grid( 1:2, 2:3 )} and
  \code{expand.grid1( 1:2, 2:3 )}.\cr
  \code{expand.grid1( 1:2, 2:3, rev=0 )} should be equal to
   native \code{expand.grid( 1:2, 2:3 )}. \cr
 \cr
 When the first element of ... is a list, expand.grid1 works
 as if it is called only with the first element.
 See the example below.\cr

 \cr
 When ... contains a matrix, better use \code{cprod}.
}
\examples{

Print( expand.grid( 1:2, 2:3 ), expand.grid1( 1:2, 2:3 ) )

res=expand.grid( 1:2, c("a","b") )
res1=expand.grid1( 1:2, c("a","b") )
Print(res,res1)


ll=list(aaa=c("a","b"),bbb=1:3)
expand.grid1(ll, colnames=0)
expand.grid1(ll, colnames=1)
expand.grid1(ll, colnames=0, rev=0)
expand.grid1(ll, colnames=1, rev=0)

expand.grid(ll,ll)
expand.grid1(ll,ll)


x=c("a","b"); y=1:3
expand.grid1(x,y, colnames=0)
expand.grid1(x,y, colnames=1)
expand.grid1(x,y, colnames=0, rev=0)
expand.grid1(x,y, colnames=1, rev=0)



}
