Description Usage Arguments Examples
Computes the Dirichlet polygons using a
SpatialPointsBreeding
object and optionally a boundary
SpatialPolygons
or a vector containing id-s located at the boundary.
1 2 3 4 5 6 7 8 9 10 | DirichletPolygons(x, boundary, ...)
## S4 method for signature 'SpatialPointsBreeding,missing'
DirichletPolygons(x, boundary, ...)
## S4 method for signature 'SpatialPointsBreeding,integer'
DirichletPolygons(x, boundary, width)
## S4 method for signature 'SpatialPointsBreeding,SpatialPolygons'
DirichletPolygons(x, boundary)
|
x |
A |
boundary |
A |
... |
passed to |
width |
argument passed to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | d = data.frame(
x = c(4, 17, 16, 41, 41, 43, 86, 62, 71, 92, 95,53, 34, 27, 53),
y = c(3, 18, 36, 6, 18, 50, 3, 21, 40, 43, 57, 62, 62, 45, 37),
id = 1:15,male = paste0('m', 1:15), female = paste0('f', 1:15),
stringsAsFactors=FALSE)
b = SpatialPointsBreeding(d, id = 'id', breeding = ~ male + female)
# boundary is inferred based on the Ripley-Rasson estimate of the spatial domain
dp1 = DirichletPolygons(b)
plot(dp1)
# boundary is given
brdy2 = rgeos::readWKT("POLYGON((28 71,67 68,70 49,84 49,90 74,111 65,107
36,78 28,98 15,98 -4,74 -7,-2 -8,0 31,28 71) )")
dp2 = DirichletPolygons(b, boundary = brdy2)
plot(dp2)
# boundary is inferred based on the boundary id-s.
# define boundary id-s using a 'Follow-The-Dots' strategy.
brdy3 = as.integer(c(1, 2, 4, 7, 9, 10, 11, 12, 13, 14, 3))
dp3 = DirichletPolygons(b, boundary = brdy3)
plot(dp3)
# setting width manually
dp4 = DirichletPolygons(b, boundary = brdy3, width = 2)
plot(dp4)
plot(dp1)
plot(dp2, add = TRUE, border = 2)
plot(dp3, add = TRUE, border = 3)
plot(dp4, add = TRUE, border = 4)
plot(b, add = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.