Description Usage Arguments Value Examples
plotable_tess
returns a dataframe of points defining the edges of the
tessellation constructed by polydeclust2d
. These points can be
used to visualize the tessellations.
1 |
points |
2D point pattern object created by package
|
A simple features (sf
) polygons dataframe. May be plotted
with geom_sf
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(ggplot2)
# Tessellation with a mask only may produce excessive edge weights.
dec <- polydeclust2d(samples$x, samples$y, mask = mask, estdomain = FALSE)
samples_dec <- cbind(samples, dec$weights)
ptess <- plotable_tess(dec$ppp)
ggplot() +
geom_raster(data = mask, aes(x, y), fill = "lightblue") +
geom_sf(data = ptess, fill = NA) +
geom_point(data = samples_dec, aes(x, y, size = weight))
# Using the `ripras` option reduces excessive edge weights.
dec <- polydeclust2d(samples$x, samples$y, mask = mask)
samples_dec <- cbind(samples, dec$weights)
ptess <- plotable_tess(dec$ppp)
ggplot() +
geom_raster(data = mask, aes(x, y), fill = "lightblue") +
geom_sf(data = ptess, fill = NA) +
geom_point(data = samples_dec, aes(x, y, size = weight))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.