Position around a polygon
pos_by_polygon(
x,
y,
where = c("left", "right", "top", "bottom", "topleft", "topright", "bottomleft",
"bottomright")
)
x-coordinate of a polygon.
y-coordinate of a polygon.
Which side of the polygon? It should take value in c("left", "right", "top", "bottom", "topleft", "topright", "bottomleft", "bottomright")
.
A numeric scalar of length two, which is the xy-coordinate of the point.
x = c(235, 235, 237, 241, 246, 248, 250, 250, 250, 253,
256, 260, 264, 263, 261, 257, 252, 247, 241, 237, 235)
y = c(418, 409, 402, 397, 394, 395, 396, 404, 411, 416, 417,
416, 415, 422, 429, 434, 437, 436, 432, 426, 418)
pos_by_polygon(x, y, "left")
#> [1] 235.0000 415.4286
pos_by_polygon(x, y, "bottomleft")
#> [1] 235 394