Re: [R] CircStats help

From: Ben Bolker <bolker_at_ufl.edu>
Date: Tue 15 Aug 2006 - 05:36:44 EST

Isabelle Deguise <ideguise <at> interchange.ubc.ca> writes:

>
> Hello,
>
>
> > x <- c(5.009684,37.814266, 295.722970, 0.000000,
> 326.463366,242.678840)
> > radx <- rad(x)
> > circ.mean(radx)
> [1] -0.4283351
> > deg(-0.4283351)
> [1] -24.54179
>
> I would just like this number to be converted to the appropriate
> angle between 0-360 degrees. Can someone help me?
>

  Just add 360 to the result ... when in doubt, you can also look at what the function is actually doing by typing the name of the function by itself, e.g.

> circ.mean

In this case it shows that the function is just adding up the sines and cosines of the individual angles and then taking the arc-tangent. With this size problem you can work through the details and understand how it all works ...

  Ben Bolker



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Aug 15 05:40:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 15 Aug 2006 - 06:22:32 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.