[R] windrose (circular package) odd table and windrose plot

Alessandro Bigi a.bigi at bham.ac.uk
Fri Jul 3 19:22:56 CEST 2009


> R.version
               _                           
platform       i486-pc-linux-gnu           
arch           i486                        
os             linux-gnu                   
system         i486, linux-gnu             
status                                     
major          2                           
minor          8.1                         
year           2008                        
month          12                          
day            22                          
svn rev        47281                       
language       R                           
version.string R version 2.8.1 (2008-12-22)

> packageDescription('circular',fields='Version')
[1] "0.3-8"

Computing a table and plotting a windrose with windrose I have odd (to me) results:

in the table data referred to some wind direction are missing
the frequency plotted in the windrose are different from those indicated in the table
some wind magnitudes are missing in the table

wdir <- rep(seq(0,135,45),10) # 4 directions 0,45,90,135 degrees
wmag <- rep(c(10,5,2,1),10) # constant mag for each direction: 10,5,2,1
t <- windrose(circular(wdir,units='degrees',template='geographics'),wmag,increment=1)

> t$table
      [0, 30) [30, 60) [60, 90) [90, 120) [120, 150) [150, 180) [180, 210)
(0,1]   0.000    0.000        0         0          0          0          0
(1,2]   0.333    0.000        0         0          0          0          0
(2,3]   0.000    0.000        0         0          0          0          0
(3,4]   0.000    0.000        0         0          0          0          0
(4,5]   0.000    0.333        0         0          0          0          0

      [210, 240) [240, 270) [270, 300) [300, 330) [330, 360)
(0,1]          0          0          0      0.333          0
(1,2]          0          0          0      0.000          0
(2,3]          0          0          0      0.000          0
(3,4]          0          0          0      0.000          0
(4,5]          0          0          0      0.000          0

The problems I can see are:
90 and 135 winds are missing
frequency for magnitude are not assigned as I was expected (mags are up to 10)
Frequency in windrose are .6 for each one of the three non-empty column

What am I doing wrong in here?
Thanks,

 Alessandro

~~~~~~~~~~~~~~~~~~
Alessandro Bigi
E-mail: a.bigi at bham.ac.uk
Tel: +44 (0)12141 47297
Location: Public Health 209 
~~~~~~~~~~~~~~~~~~



More information about the R-help mailing list