Debian Codegraph @

man/xy.grid.Rd

raw
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{
10 xy.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{
23 plot(xy.grid(1:7, 10*(0:4)))
24
25 x <- 1:3 ; y <- 10*(0:4)
26 xyg <- xy.grid(x,y)
27
28 ## Compare with expand.grid() :
29 m2 <- as.matrix(expand.grid(y,x)[, 2:1])
30 dimnames(m2) <- NULL
31 stopifnot(identical(xyg, m2))
32 }
33 \keyword{array}