coords_to_position {hilbert} | R Documentation |
Convert Coordinates to Grid Positions
Description
Convert Coordinates to Grid Positions
Usage
coords_to_position(x, ..., n = 10L, extent = NULL)
## S3 method for class 'data.frame'
coords_to_position(x, ..., n, extent, coords = c(1, 2), attach = TRUE)
## S3 method for class 'matrix'
coords_to_position(x, ..., n, extent, coords = c(1, 2), attach = TRUE)
## S3 method for class 'numeric'
coords_to_position(x, y, ..., n, extent)
## S3 method for class 'double'
coords_to_position(x, y, ..., n, extent)
## S3 method for class 'integer'
coords_to_position(x, y, ..., n, extent)
coords_to_position64(x, ..., n = 10L, extent = NULL)
## S3 method for class 'data.frame'
coords_to_position64(x, ..., n, extent, coords = c(1, 2), attach = TRUE)
## S3 method for class 'matrix'
coords_to_position64(x, ..., n, extent, coords = c(1, 2), attach = TRUE)
## S3 method for class 'numeric'
coords_to_position64(x, y, ..., n, extent)
## S3 method for class 'double'
coords_to_position64(x, y, ..., n, extent)
## S3 method for class 'integer'
coords_to_position64(x, y, ..., n, extent)
Arguments
x |
One of: Numeric vector, |
... |
Unused. |
n |
Exponent to the dimensions of the underlying grid. The Hilbert
Curve indices are based on a |
extent |
Named vector with names |
coords |
Column names or indices of a |
attach |
If |
y |
Numeric vector corresponding to Y coordinates. |
Value
A data.frame
containing the positions as integer
columns x
and y
, or the original object
(data.frame
or matrix
) with the coordinates
replaced with the grid positions. When n
is greater than 15,
the positions are of type bit64::integer64
.