simple_shapes {transformr} | R Documentation |
Some different geometries to play with
Description
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.
Usage
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)
Arguments
st |
Logical. Should the geometry be returned as an |
detail |
The number of points defining the shape |
n |
For |
r , r1 |
The radius of the geometry. |
windings |
The number of revolutions in the spiral |
w1 , w2 |
The frequency for the two sine waves |
dim |
the number of rows and columns in the grid |
Value
Either a data.frame or an sf feature depending on the value of st
Examples
# Create a 7-pointed star
poly_star(n = 7)