[R] Windrose Percent Interval Frequencies Are Non Linear! Help!

Peter Ehlers ehlers at ucalgary.ca
Fri Apr 8 20:05:31 CEST 2011


On 2011-04-08 09:26, Ben Bolker wrote:
> Brittain Briber<brittbriber<at>  yahoo.com>  writes:
>
>>    Do you two or anyone
>> else out there happen to know if it is possible to specify the
>>   width of the intervals in windrose?  Is there
>> a parameter that I can pass along that would do this?
>>   Below is a reproducible script in which you can see
>> the uneven interval spacing.  And thanks again for your answers.
>>
>> Best
>> Britt
>
>    The "Details" of ?windrose in circular says
> quite explicitly that it preserves the areas of "pedals" [sic],
> so it's unlikely that this is adjustable without hacking the
> code. (Hmmm, maybe I will write to the maintainers and ask
> them to correct the spelling of "petals" throughout ...)
>
>    On the other hand, there are a *lot* of alternative windrose/circular
> histogram-plotting functions out there in CRAN-contrib-land.
> library("sos"); findFn("wind rose") finds them in packages
> plotrix, openair, oce, climatol, IDPmisc, ggplot2 ... and
> that's not counting rose.diag in the CircStats package.
>
>    I would take a quick look and see if any of those packages
> work for you.
>
>    Ben Bolker


Brittain,

I think that Ben is correct: you would have to hack the code.
Here's a way around that, but it just seems to show up another
problem in windrose():

   set.seed(1)
   x <- circular(runif(100, 0, 360), units="degrees")
   y <-  rgamma(100, 15)
   DF <- data.frame(x, y)
   windrose(DF, fill.col='yellow', cir.ind=NULL)

## now superpose a set of circles
   symbols(matrix(0,5,2), circles=1:5/5, inches=FALSE,
           fg="red", add=TRUE)

There is obviously a problem with the aspect ratio and I
think it's in windrose(). Here's a more pronounced look
at the problem:

   windrose(DF, fill.col='yellow', cir.ind=NULL, bins=1)
   symbols(0, 0, circles=1, inches=FALSE,
           fg="red", add=TRUE)

You could also have a look at the draw.circle() function
in the plotrix package.

Peter Ehlers

>
> ______________________________________________
> 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.



More information about the R-help mailing list