gridVector | R Documentation |
Creates rectangular grid coordinates from two vectors.
gridVector(x, y = NULL)
x , y |
numeric vectors |
The grid is obtained by pairing each element of y
with all
elements of x
. The X
and Y
coordinates of the
points are stored in separate vectors. This is convenient, for
example, for plotting. It can be useful also for brute force
optimisation or simulation.
If y
is NULL
, the default, then y = x
.
a list with two components, X
and Y
, giving the
coordinates which span the bivariate grid.
expand.grid
## a small grid vector with row and col transformations
gridVector(0:2)
data.frame(gridVector(0:2))
do.call("rbind", gridVector(0:2))
gridVector(0:2, 0:3)
## grid over a unit square
gridVector((0:10)/10) # equivalently: gridVector((0:10)/10, (0:10)/10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.