nudge_JamPolygon: Nudge JamPolygon coordinates

nudge_JamPolygonR Documentation

Nudge JamPolygon coordinates

Description

Nudge JamPolygon coordinates

Usage

nudge_JamPolygon(
  jp,
  nudge = NULL,
  rotate_degrees = 0,
  center = NULL,
  verbose = FALSE,
  ...
)

Arguments

jp

JamPolygon object

nudge

list whose names match names(jp), containing numeric vector with names "x" and "y". For example: nudge=list(polyname1=c(x=1, y=0))

...

additional arguments are ignored

Details

Polygon coordinates within a JamPolygon object are nudged by name or polygon number, such that all parts of each polygon are adjusted together. For multi-part polygons, and/or polygons with internal holes, all parts are moved the identical amount.

See Also

Other JamPolygon: JamPolygon-class, Venndir-class, [,JamPolygon,ANY,ANY,ANY-method, add_orientation_JamPolygon(), area_JamPolygon(), bbox_JamPolygon(), buffer_JamPolygon(), check_JamPolygon(), check_Venndir(), eulerr_to_JamPolygon(), farthest_point_JamPolygon(), find_venn_overlaps_JamPolygon(), has_point_in_JamPolygon(), intersect_JamPolygon(), label_fill_JamPolygon(), label_outside_JamPolygon(), label_segment_JamPolygon(), labelr_JamPolygon(), minus_JamPolygon(), nearest_point_JamPolygon(), plot.JamPolygon(), point_in_JamPolygon(), polyclip_to_JamPolygon(), polygon_circles(), polygon_ellipses(), sample_JamPolygon(), split_JamPolygon(), union_JamPolygon(), update_JamPolygon()

Examples

DEdf <- data.frame(check.names=FALSE,
   name=c("D", "E"),
   x=I(list(
      c(-3, 3, 3, 0, -3),
      c(-4, 2, 2, -4))),
   y=I(list(
      c(-3, -3, 1.5, 4, 1.5),
      c(-2, -2, 4, 4))),
   fill=c("#FFD70055", "#B2222255"))
DEjp <- new("JamPolygon", polygons=DEdf)
plot(DEjp)
nudge <- list(D=c(7, 1), E=c(-1, -1));
DEjp_nudged <- nudge_JamPolygon(DEjp, nudge=nudge)
plot(DEjp_nudged)

plot(rbind2(DEjp, DEjp_nudged),
   fill=c("#FFD70055", "#B2222255", "gold", "firebrick"),
   label=c("D_old", "E_old", "D_new", "E_new"),
   border.lty=c(2, 2, 1, 1))


jmw86069/venndir documentation built on Nov. 14, 2024, 10:12 a.m.