Description Usage Arguments Value Author(s) See Also Examples
Creates a grid with given cell dimensions
1 | GRTS.polygon(spPolygon, cellsize, Subset = FALSE, RandomStart = FALSE)
|
spPolygon |
A |
cellsize |
A single number defining the size of each grid cell. |
Subset |
A logical value indicating wether the entire GRTS grid should
be returned ( |
RandomStart |
A logical value indicating wether the GRTS grid should
start at the minimum of the coordinates plus half the |
A SpatialGridDataFrame
if Subset == FALSE
or a
SpatialPixelsDataFrame
if Subset == TRUE
. The variable
Ranking
contains the randomised order of the cells.
Thierry Onkelinx Thierry.Onkelinx@inbo.be, Paul Quataert
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(sp)
Sr1 <- Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))
Sr2 <- Polygon(cbind(c(5,4,2,5),c(2,3,2,2)))
Sr3 <- Polygon(cbind(c(4,4,5,10,4),c(5,3,2,5,5)))
Sr4 <- Polygon(cbind(c(5,6,6,5,5),c(4,4,3,3,4)), hole = TRUE)
Srs1 <- Polygons(list(Sr1), "s1")
Srs2 <- Polygons(list(Sr2), "s2")
Srs3 <- Polygons(list(Sr3, Sr4), "s3/4")
SpP <- SpatialPolygons(list(Srs1,Srs2,Srs3), 1:3)
output <- GRTS(SpP, cellsize = 0.1)
spplot(output)
output <- GRTS(SpP, cellsize = 0.1, Subset = TRUE, RandomStart = TRUE)
spplot(output)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.