View source: R/transform_gate-methods.R
rotate_gate | R Documentation |
Rotate a Gate-type filter object through a specified angle
## Default S3 method:
rotate_gate(obj, deg = NULL, rot_center = NULL, ...)
obj |
An |
deg |
An angle in degrees by which the gate should be rotated in the counter-clockwise direction |
rot_center |
A separate 2-dimensional center of rotation for the gate, if desired. By default, this will
be the center for |
... |
Additional arguments not used |
This method allows for 2-dimensional geometric rotation of filter types defined by simple geometric gates
(ellipsoidGate
, and polygonGate
). The method is not defined
for rectangleGate
or quadGate
objects, due to their definition as having 1-dimensional boundaries.
Further, keep in mind that the 2-dimensional rotation takes place in the plane where the dimensions
of the two variables are evenly linearly scaled. Displaying a rotated ellipse in a plot where the axes are not scaled
evenly may make it appear that the ellipse has been distorted even though this is not the case.
The angle provided in the deg
argument should be in degrees rather than radians. By default, the rotation
will be performed around the center of an ellipsoidGate
or the centroid of the area encompassed by
a polygonGate
. The rot_center
argument allows for specification of a different center of rotation
for polygonGate
objects (it is not yet implemented for ellipsoidGate
objects) but
it is usually simpler to perform a rotation and a translation individually than to manually specify
the composition as a rotation around a shifted center.
A Gate-type filter
object of the same type as gate
, with the rotation applied
## Not run:
#' # Rotates the original gate 15 degrees counter-clockwise
rotated_gate <- rotate_gate(original_gate, deg = 15)
# Rotates the original gate 270 degrees counter-clockwise
rotated_gate <- rotate_gate(original_gate, 270)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.