View source: R/is_regular_grid.R
is_regular_grid | R Documentation |
Assess if the coordinates x,y of an object conforms a regular grid. This function is called by its side effects.
This function is internally called by as_spatraster()
.
is_regular_grid(xy, digits = 6)
xy |
A matrix, data frame or tibble of at least two columns representing x and y coordinates. |
digits |
integer to set the precision for detecting whether points are on a regular grid (a low number of digits is a low precision). |
invisible()
if is regular or an error message otherwise
as_spatraster()
Other helpers:
compare_spatrasters()
,
is_grouped_spatvector()
,
pull_crs()
p <- matrix(1:90, nrow = 45, ncol = 2)
is_regular_grid(p)
# Jitter location
set.seed(1234)
jitter <- runif(length(p)) / 10e4
p_jitter <- p + jitter
# Need to adjust digits
is_regular_grid(p_jitter, digits = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.