divide_polygons | R Documentation |
stripper
divides polygons into horizontal or vertical strips of a specified relative size.
divider
divides a SpatVector
of polygons into n
compact and approximately equal area parts. The results are not deterministic so you should use set.seed
to be able to reproduce your results. If you get a warning about non-convergence, you can increase the number of iterations used with additional argument iter.max
divider(x, n, env=NULL, alpha=1, ...)
stripper(x, f=c(1/3, 2/3), vertical=TRUE)
x |
SpatVector of polygons |
n |
positive integer. The number of parts requested |
env |
SpatRaster with environmental data |
alpha |
numeric. One or two numbers that act as weights for the x and y coordinates |
... |
additional arguments such as |
f |
numeric vector of fractions. These must be > 0 and < 1, and in ascending order |
vertical |
logical. If |
SpatVector
stripper was derived from a function by Barry Rowlingson
f <- system.file("ex/lux.shp", package="terra")
v <- aggregate(vect(f))
set.seed(33)
d1 <- divider(v, 10)
plot(d1)
d2 <- divider(v, 100)
boxplot(expanse(d2, "km"))
x <- stripper(v, seq(0.1, 0.9, 0.1))
round(expanse(x,"km"), 1)
plot(x, col=rainbow(12))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.