View source: R/checkcellalignment.R
checkcellalignment | R Documentation |
This function checks to see whether individual cells from one object align with those from another. The extents do not have to match or even overlap.
checkcellalignment(x, y)
x, y |
grid objects or a list with, as a minimum, the elements: |
The function will throw an error if the two objects don't have matching cell
alignment.
Alignment doesn't have to be absolutely perfect but must be very close;
this allows for rounding error when cellsize is not an integer.
See all.equal
for more on the tolerances.
If the two grids align then the function will return TRUE
,
otherwise it will throw an error.
matchextent
,gridio2::gridintersect
,
gridio2::overlay
all use this function.
gridio2::coincide
checks to see if two objects have matching cell
alignment and extent.
a <- list(xll = 0, yll = 0, cellsize = 10, nrow = 100, ncol = 100)
b <- list(xll = 1000, yll = 2000, cellsize = 10, nrow = 50, ncol = 200)
checkcellalignment(a, b) # TRUE
## Not run:
c <- list(xll = 1, yll = 0, cellsize = 10, nrow = 100, ncol = 100)
checkcellalignment(a, c) # Error in checkcellalignment(a, c) :
# Grids are misaligned in the x direction
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.