geo_stretch | R Documentation |
Stretch geometric objects by a scale factor in x and y dimension.
geo_stretch(obj, x = NULL, y = NULL, fid = NULL, update = TRUE)
obj |
gridded(1) |
x |
numeric(1) |
y |
numeric(1) |
fid |
integerish(.) |
update |
logical(1) |
geom
of the stretched obj
.
Other geometry tools:
geo_filter()
,
geo_locate()
,
geo_pull()
,
geo_reflect()
,
geo_rotate()
,
geo_scale()
,
geo_skew()
,
geo_translate()
# stretch several features
geo_vis(gtGeoms$polygon, linewidth = 3)
newPoly <- geo_stretch(obj = gtGeoms$polygon, x = 0.5, y = 0.2,
update = FALSE)
geo_vis(geom = newPoly, linecol = "green", new = FALSE)
# stretch a single feature
geo_vis(gtGeoms$polygon, linewidth = 3)
newPoly <- geo_stretch(obj = gtGeoms$polygon, x = 0.5, fid = 2, update = FALSE)
geo_vis(geom = newPoly, linecol = "green", new = FALSE)
# stretch feature separately
geo_vis(gtGeoms$polygon, linewidth = 3)
newPoly <- geo_stretch(obj = gtGeoms$polygon,
x = c(0.2, 1),
y = c(1, 0.2),
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.