Re: [R] Range of circular data

From: <Richard.Cotton_at_hsl.gov.uk>
Date: Tue, 8 Jan 2008 09:59:40 +0000


> I want to get the minimum arc (in degrees) needed to include a set of
> compass directions. I would like to use the range.circular() function
> of the package circular, because that package understands a compass-type
> of angle convention, but it gives results I don't understand. Howver, I
> can get the correct answer in the example below, 90 degrees, using the
> CircStats package. How can I make the circular package work for me?
>
> > R.version.string
> [1] "R version 2.6.1 (2007-11-26)"
>
> > library(circular)
> > y <- circular(c(45, 135), units = "degrees", template = "geographics")
> > range.circular(y)
> Circular Data:
> Type = angles
> Units = degrees
> Template = geographics
> Modulo = asis
> Zero = 1.570796
> Rotation = clock
> [1] 0

Using y <- circular(c(45, 135), units = "degrees"); range.circular(y) gives the correct answer.
Circular Data:
Type = angles
Units = degrees
Template = none
Modulo = asis
Zero = 0
Rotation = counter
[1] 90

The different answers are generated in the subfunction conversion.circular - take a look in there to see what is going on.

Regards,
Richie.

Mathematical Sciences Unit
HSL



ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}

R-help_at_r-project.org 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 08 Jan 2008 - 10:03:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Jan 2008 - 10:30:05 GMT.

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

list of date sections of archive