[R] CircStats help

Ben Bolker bolker at ufl.edu
Mon Aug 14 21:36:44 CEST 2006


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



More information about the R-help mailing list