Sample points within JamPolygon
JamPolygon
integer
number of points required
numeric
adjustment for the x/y ratio, numbers larger than
1 make the x-axis spacing larger than the y-axis spacing.
logical
(default TRUE
) when more then n
points can
be fit inside the polygon, spread=TRUE
spreads the points evenly
across the available points, while spread=FALSE
simply uses
the first n
points.
numeric
ratio which must be 1
or higher, indicating
how many total sampled points should be defined, before choosing
the points to use. This option is used only when spread=TRUE
,
which causes more points to be defined, from which it uses
evenly distributed values.
character
string indicating how to array the points:
"offset"
(default) uses a rectangular grid where alternating
points on each row are offset slightly on the y-axis.
"rectangle"
uses a rectangular grid with points on each row
that share the same y-axis value.
numeric
optional buffer used to adjust the jp
polygon
size overall, where negative values will slightly shrink the
polygon border. Points are sampled after this adjustment.
character
passed to jamba::mixedSortDF()
to determine
how to sort the resulting coordinates. Default byCols=c("-y", "x")
sorts top-to-bottom, then left-to-right.
logical
indicating whether to create a plot to illustrate
the process.
logical
indicating whether to print verbose output.
additional arguments are ignored.
This function arrays points across solid portions of polygons
provided in jp
.
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()
,
nudge_JamPolygon()
,
plot.JamPolygon()
,
point_in_JamPolygon()
,
polyclip_to_JamPolygon()
,
polygon_circles()
,
polygon_ellipses()
,
split_JamPolygon()
,
union_JamPolygon()
,
update_JamPolygon()
df3 <- data.frame(name=c("polygon1", "polygon2"),
label=c("polygon1", "polygon2"),
x=I(list(
list(c(1, 6, 6, 1),
c(2, 5, 5, 2),
c(3, 4, 4, 3)),
list(#c(11, 16, 16, 11),
c(12, 15, 15, 12),
c(13, 14, 14, 13))
)),
y=I(list(
list(c(1, 1, 6, 6),
c(2, 2, 5, 5),
c(3, 3, 4, 4)),
list(#c(1, 1, 6, 6),
c(2, 2, 5, 5),
c(3, 3, 4, 4))
)),
fill=c("gold", "firebrick"))
jp3 <- new("JamPolygon", polygons=df3);
sample_JamPolygon(jp3[1,], n=40, do_plot=TRUE)
sample_JamPolygon(jp3[1,], n=80, do_plot=TRUE)
sample_JamPolygon(jp3[1,], n=40, xyratio=1.5, do_plot=TRUE)
sample_JamPolygon(jp3[1,], n=40, xyratio=1/1.5, do_plot=TRUE)