gt_skew: Skew geometric objects

Description Usage Arguments Value See Also Examples

View source: R/gt_skew.R

Description

Skew geometric objects by a shear factor in x and y dimension.

Usage

1
gt_skew(obj, x = NULL, y = NULL, fid = NULL, update = TRUE)

Arguments

obj

[geometric object(1)]
the object to skew.

x

[numeric(1)]
the shear factor in x dimension.

y

[numeric(1)]
the shear factor in y dimension.

fid

[integerish(.)]
in case only a subset of features shall be skewed, specify that here.

update

[logical(1)]
whether or not to update the window slot after skewing.

Value

geom of the skewed obj.

See Also

Other geometry tools: gt_filter(), gt_locate(), gt_pull(), gt_reflect(), gt_rotate(), gt_scale(), gt_stretch(), gt_translate()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# skew several features
visualise(gtGeoms$polygon, linewidth = 3)
newPoly <- gt_skew(obj = gtGeoms$polygon, x = 0.5, update = FALSE)
visualise(geom = newPoly, linecol = "green", new = FALSE)

# skew a single feature
visualise(gtGeoms$polygon, linewidth = 3)
newPoly <- gt_skew(obj = gtGeoms$polygon, x = 0.5, y = .7, fid = 2,
                   update = FALSE)
visualise(newPoly, linecol = "green", new = FALSE)

geometr documentation built on Sept. 21, 2021, 1:07 a.m.