These functions are provided to allow you to play with somee simple shapes as
you explore transformr and are also used in the examples for the different
tween functions. All geometries can be returned as either a standard
data.frame with x, y, and id column, or as an sf geometry of the
appropriate type.
poly_circle(st = FALSE, detail = 360)poly_circles(st = FALSE, n = 3, r = 0.25, detail = 360)
poly_star(st = FALSE, n = 5, r1 = 0.5)
poly_star_hole(st = FALSE, n = 5, r1 = 0.5)
path_spiral(st = FALSE, windings = 5)
path_waves(st = FALSE, w1 = 7, w2 = 11)
point_random(st = FALSE, n = 10)
point_grid(st = FALSE, dim = 5)
Either a data.frame or an sf feature depending on the value of st
Logical. Should the geometry be returned as an sf feature?
The number of points defining the shape
For poly_circles the number of circles, for poly_star and
poly_star_hole the number of 'arms', and for point_random the number of
points
The radius of the geometry. r gives the radius of the circles
in poly_circles and r1 gives the inner radius for
poly_star/poly_star_hole, thus determining how pointy it is
The number of revolutions in the spiral
The frequency for the two sine waves
the number of rows and columns in the grid
# Create a 7-pointed star
poly_star(n = 7)
Run the code above in your browser using DataLab