0

I am trying to plot a wind rose plot of a site using openair package in R. The code snippet is:

windRose(df, type = "season", paddle = F, key.position = "right") and the plot is: enter image description here

We know, this package openair considers seasons DJF as winter, MAM as spring and so on. However, in this region another categorization for seasons is commonly used as follows:

  • winter: Dec Jan Feb
  • Pre-monsoon: Mar Apr May Jun15 (i.e. till 15th of June)
  • Monsoon: 15Jun Jul Aug Sep (i.e. from 15th of June)
  • Post-monsoon: Oct Nov.

I am new in R, hence finding difficulty to plot the wind rose with the later categorization and putting the titles accordingly. I would highly appreciate any help.

Thanks!

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Peshal1067
  • 183
  • 1
  • 10

1 Answers1

0

Function windRose has an argument "type" which accepts a custom character or factor vector to facet (and label) the plot by.

  1. add a column for your custom season, e.g. "my_custom_season"
  2. make this column contain the corresponding season for each row ("winter", "pre-monsoon" etc.)
  3. call windRose(your_data,...,type="my_custom_season")
  • thanks for the reply. But my main problem here is first to select the data according to the new seasons. Like for premonsoon I want to select data between Mar, Apr, May and till June 15 and so on. Can you please provide any help on this? – Peshal1067 Mar 01 '22 at 04:46
  • 1
    For one possibility to convert dates into custom intervals (e.g. seasons) please see: https://stackoverflow.com/a/39894310/18309711 . That solution requires an extra package ({lubridate}) for convenient handling of various date and time types. –  Mar 01 '22 at 09:42