wrap {activity} | R Documentation |
Wraps data on a given range.
Description
Input data outside the given bounds (default radian [0, 2*pi]) are wrapped to appear within the range.
Usage
wrap(x, bounds = c(0, 2 * pi))
Arguments
x |
A vector of numeric data. |
bounds |
The range within which to wrap |
Details
As an example of wrapping, on bounds [0, 1], a value of 1.2 will be converted to 0.2, while a value of -0.2 will be converted to 0.8.
Value
A vector of numeric values within the limits defined by bounds
Examples
data(BCItime)
adjtime <- BCItime$time + 1/24
summary(adjtime)
adjtime <- wrap(adjtime, c(0,1))
summary(adjtime)
[Package activity version 1.3.4 Index]