1\name{xy.grid}
2\alias{xy.grid}
3\title{Produce regular grid matrix.}
4\description{
5  Produce the grid used by \code{\link{persp}}, \link{contour}, etc, as
6  an \code{N x 2} matrix.
7  This is really outdated by \code{\link{expand.grid}()} nowadays.
8}
9\usage{
10xy.grid(x, y)
11}
12\arguments{
13  \item{x,y}{any vectors of same mode.}
14}
15\value{
16  a 2-column matrix of \dQuote{points} for each combination of \code{x} and
17  \code{y}, i.e. with \code{length(x) * length(y)} rows.
18}
19\author{Martin Maechler, 26 Oct 1994.}
20\seealso{\code{\link{expand.grid}} which didn't exist when
21  \code{xy.grid} was first devised.}
22\examples{
23plot(xy.grid(1:7, 10*(0:4)))
24
25x <- 1:3 ;  y <- 10*(0:4)
26xyg <- xy.grid(x,y)
27
28## Compare with expand.grid() :
29m2 <- as.matrix(expand.grid(y,x)[, 2:1])
30dimnames(m2) <- NULL
31stopifnot(identical(xyg, m2))
32}
33\keyword{array}
34