grd_cell | R Documentation |
Grid cell operators
grd_cell(grid, point, ..., snap = grd_snap_next)
grd_cell_range(
grid,
bbox = wk_bbox(grid),
...,
step = 1L,
snap = grd_snap_next
)
grd_cell_rct(grid, i, j = NULL, ...)
## S3 method for class 'wk_grd_rct'
grd_cell_rct(grid, i, j = NULL, ..., out_of_bounds = "keep")
## S3 method for class 'wk_grd_xy'
grd_cell_rct(grid, i, j = NULL, ..., out_of_bounds = "keep")
grd_cell_xy(grid, i, j = NULL, ...)
## S3 method for class 'wk_grd_rct'
grd_cell_xy(grid, i, j = NULL, ..., out_of_bounds = "keep")
## S3 method for class 'wk_grd_xy'
grd_cell_xy(grid, i, j = NULL, ..., out_of_bounds = "keep")
grid |
A |
point |
A handleable of points. |
... |
Unused |
snap |
A function that transforms real-valued indices to integer
indices (e.g., |
bbox |
An |
step |
The difference between adjascent indices in the output |
i , j |
1-based index values. |
out_of_bounds |
One of 'keep', 'censor', 'discard', or 'squish' |
grd_cell()
: returns a list(i, j)
of index values corresponding
to the input points and adjusted according to snap
. Index values
will be outside dim(grid)
for points outside wk_bbox(grid)
including
negative values.
grd_cell_range()
returns a slice describing the range of indices
in the i
and j
directions.
grd_cell_rct()
returns a rct()
of the cell extent at i, j
.
grd_cell_xy()
returns a xy()
of the cell center at i, j
.
grid <- grd(nx = 3, ny = 2)
grd_cell(grid, xy(0.5, 0.5))
grd_cell_range(grid, grid$bbox)
grd_cell_rct(grid, 1, 1)
grd_cell_xy(grid, 1, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.