geo_rotate | R Documentation |
Rotate geometric objects by a certain angle about center coordinates
geo_rotate(obj, x = NULL, y = NULL, angle = NULL, fid = NULL, update = TRUE)
obj |
gridded(1) |
x |
numeric(1) |
y |
numeric(1) |
angle |
numeric(1) |
fid |
integerish(.) |
update |
logical(1) |
geom
of the rotated obj
.
Other geometry tools:
geo_filter()
,
geo_locate()
,
geo_pull()
,
geo_reflect()
,
geo_scale()
,
geo_skew()
,
geo_stretch()
,
geo_translate()
# rotate all geoms
geo_vis(gtGeoms$polygon, linewidth = 3)
newPoly <- geo_rotate(obj = gtGeoms$polygon, x = 0, y = 0, angle = 135,
update = FALSE)
geo_vis(geom = newPoly, linecol = "green", new = FALSE)
# rotate a single geom
geo_vis(gtGeoms$polygon, linewidth = 3)
newPoly <- geo_rotate(obj = gtGeoms$polygon, x = -10, y = 0, angle = -180,
update = FALSE, fid = 2)
geo_vis(geom = newPoly, linecol = "green", new = FALSE)
# rotate different geoms about different centers by different angles
geo_vis(gtGeoms$polygon, linewidth = 3)
newPoly <- geo_rotate(obj = gtGeoms$polygon,
x = c(0, -10),
y = c(-10, 0),
angle = c(75, -135),
update = FALSE)
geo_vis(geom = newPoly, linecol = "green", new = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.