Thanks Robin.  I used the following line, which got my table looking
correct.

Wind_freq_speed <- t(table(cut(Wind_Dir_vec, 0:36), cut(Wind_Speed_vec,
seq(0, to=60, by=10))))

Unfortunately, the rosavent function produced a wind rose diagram that
repeats my frequency data 6 times throughout the 360 degrees and I get the
following error:

Error in legend(-fmaxi - 2 * fint, fmaxi, fill = col, legend = attr(frec,  :

  'legend' is of length 0

Not sure what to do now that my table is set up like the windfreq.dat table
used in the rosavent example.  I think I may check out some of these
auxillary controls for rose diagrams.  Any thoughts are welcome.

Thanks.


On Sat, Apr 17, 2010 at 2:24 AM, Robin Evans <rj...@stat.washington.edu>wrote:

> > but I need to incorporate the speed values and have a table like the
> > following:
> >                 1     2     3     4     5     6 .... 36
> > 0-9
> > 10-19
> > 20-29
> > 30-39
> > 40-49
> > 50+
> > The final table will be used in the rosavent function to produce a wind
> rose
> > diagram just like in this example:
>
> The table() command will accept an arbitrary number of factors as its
> first arguments, and cross tabulate the frequencies for all of them.
> So
>
> table(cut(Wind_Dir_vec, 0:36), cut(Wind_Speed, seq(9.5, to=49.5, by=10)))
>
> should do more or less what you want.
>
> > --
> > Kevin Turner
> > Department of Geography
> > and Environmental Studies
> > Wilfrid Laurier University
> > Waterloo, Ontario
> > [[alternative HTML version deleted]]
>
> --
> Robin Evans
> Statistics Department
> University of Washington
> www.stat.washington.edu/~rje42 <http://www.stat.washington.edu/%7Erje42>
>



-- 
Kevin Turner
Department of Geography
and Environmental Studies
Wilfrid Laurier University
Waterloo, Ontario

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to