Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

circular

Create Objects of class circular for Circular data.


Description

The function circular is used to create circular objects. as.circular and is.circular coerce an object to a circular and test whether an object is a circular data.

Usage

circular(x, type = c("angles", "directions"), 
  units = c("radians", "degrees", "hours"),
  template = c("none", "geographics", "clock12", "clock24"),
  modulo = c("asis", "2pi", "pi"), 
  zero = 0, rotation = c("counter", "clock"), names)
## S3 method for class 'circular'
as(x, control.circular=list(), ...)
## S3 method for class 'circular'
is(x)
## S3 method for class 'circular'
print(x, info=TRUE, ...)

Arguments

x

a vector or a matrix. If a data.frame is supply then it is corced to a matrix.

type

the type of measures (Not Used Yet).

units

units of the measures.

template

how the data should be plotted. This set modulo, zero and rotation to some suitable values. For instance for 'geographics': zero=pi/2 and rotation='clock'. It is also used to set default labels on the plots.

modulo

if we need to reduce the measures to modulo.

zero

the zero of the axes (in radians, counter).

rotation

the orientation of the axes.

names

names of the data.

info

if TRUE information on the properties of the data are printed.

control.circular

the attribute (coordinate system) used to coerced the resulting objects. See circular.

...

For as.circular an alternative way of setting the coordinate system of the resulting objects. Passed parameters to print.default for print.circular.

Value

an object of class circular. Since version 0.3-5 the previous class of the object is retain.

Author(s)

Claudio Agostinelli

See Also

Examples

x <- circular(c(pi, pi/3, pi/4))
print(x)
is.circular(x)

x <- circular(runif(10, -pi/2, pi/2), template="geographics")
plot(x)
class(x)

x <- circular(data.frame(runif(10, -pi/2, pi/2)))
plot(x)
class(x)

cbind(x, x) # the matrix, cbind, rbind functions unclass and lost attributes! 
########Use it with care.

x <- c(pi/12,2*pi+pi/12)
print(x)
x <- unique(x)
print(x)

x[1]==x[2]

all.equal(x[1], x[2])

x <- as.circular(pi, control.circular=list(units="radians", zero=pi))
y <- conversion.circular(circular(pi), zero=pi)
res <- plot(x)
points(y, col=2, plot.info=res)

circular

Circular Statistics

v0.4-93
GPL-2
Authors
Ulric Lund <ulund@calpoly.edu> [aut], Claudio Agostinelli <claudio.agostinelli@unitn.it> [aut, cre], Hiroyoshi Arai <h_arai@aoni.waseda.jp> [ctb], Alessando Gagliardi <gagliardi@stud.unive.it> [ctb], Eduardo Garcia Portugues <edgarcia@est-econ.uc3m.es> [ctb], Dimitri Giunchi <dimitri.giunchi@unipi.it> [ctb], Jean-Olivier Irisson <irisson@normalesup.org> [ctb], Matthew Pocernich <pocernic@ucar.edu> [ctb], Federico Rotolo [ctb]
Initial release
2017-06-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.