Description Usage Arguments Value Examples
Grid cell operators
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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 'grd_rct'
grd_cell_rct(grid, i, j = NULL, ..., out_of_bounds = "keep")
## S3 method for class 'grd_xy'
grd_cell_rct(grid, i, j = NULL, ..., out_of_bounds = "keep")
grd_cell_xy(grid, i, j = NULL, ...)
## S3 method for class 'grd_rct'
grd_cell_xy(grid, i, j = NULL, ..., out_of_bounds = "keep")
## S3 method for class '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 |
1-based index values. |
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 wk::rct()
of the cell extent at i, j
.
grd_cell_xy()
returns a wk::xy()
of the cell center at i, j
.
1 2 3 4 5 | 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.