wrapdeg | R Documentation |
Wraps and adjusts angular values within a given range.
wrapdeg(deg, min = 0, leftopen = FALSE, rad = FALSE)
deg |
Numerics. Angular values you want to adjust. |
min |
A numeric. The minimal value (left limit) of angular range. |
leftopen |
A logical. Whether to use left-open ranging.
By default |
rad |
A logical. Whether the values are in radian unit or not. |
Angular values (degrees and radians) are one of the popular parameters
you need to handle during analyses,
especially in visual tasks and 2-D motor tasks.
wrapdeg()
wraps the given angular values into a given range of degree
e.g., from 0 to 360, or from -180 to 180.
The range is by default right-opened,
i.e., does include the min
but does not include min + 360
.
Left-opening is available when leftopen
is set TRUE
.
It also allows radian operation when rad
is TRUE
.
Numerics. Angular values adjusted to fit within the given range.
d <- c(-120, -45, 0, 90, 180, 360)
r <- d / 180 * pi
wrapdeg(d)
wrapdeg(d, -180)
wrapdeg(d, -180, leftopen = TRUE)
wrapdeg(r, -pi, rad = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.