Learn R Programming

circular (version 0.5-1)

conversion.circular: Unit of Measure Conversion for Circular Data and other conversions

Description

Conversion for Circular Data from one coordinate/units system to another one. For back compatibility, without arguments the function converts data from degrees to radians.

Usage

conversion.circular(x, units = c("radians", "degrees", "hours"), type = NULL, 
  template = NULL, modulo = NULL, zero = NULL, rotation = NULL)

Value

an object of class circular with the specified unit of measure, modulo, zero and rotation.

Arguments

x

an object of class circular.

units

unit of the transformed data.

type

type of the transformed data. If NULL no action is performed.

template

template of the transformed data. If NULL no action is performed.

modulo

modulo of the transformed data. If NULL no action is performed.

zero

zero of the transformed data. If NULL no action is performed.

rotation

rotation of the transformed data. If NULL no action is performed.

Author

Claudio Agostinelli

See Also

deg and rad. If you want to set the properties of an object instead to transform it, you can use circular or circularp<-.

Examples

Run this code
x <- rvonmises(n=10, mu=circular(0), kappa=9, control.circular=list(units="degrees"))
par(mfcol=c(2, 2))
plot(x)
y <- conversion.circular(x) # only the unit is changed (to radians) and 
####### the data converted.
plot(y)
z <- conversion.circular(x, units="degrees", zero=pi) # only the zero is changed and 
####### the data converted.
plot(z)
w <- conversion.circular(x, zero=pi, rotation="clock") # zero and rotation is 
####### changed and the data converted.
plot(w)

Run the code above in your browser using DataLab