windrose              package:circular              R Documentation

_W_i_n_d_r_o_s_e _G_e_n_e_r_a_t_o_r

_D_e_s_c_r_i_p_t_i_o_n:

     This function creates a windrose used to visualize the direction
     and magnitude of wind.  The pedals of a windrose indicate the
     proportion of time wind comes from a given direction. Bands on the
     windrose indicate the proportions of winds of each magnitude.

_U_s_a_g_e:

     windrose(x, y=NULL, breaks=NULL, bins=12, increment = 10, main='Wind Rose', cir.ind = 0.05, fill.col=NULL, plot.mids=TRUE, mids.size=1.2, osize=0.1, axes=TRUE, ticks=TRUE, tcl=0.025, tcl.text=-0.15, cex = 1, digits=2, num.ticks=12, xlim=c(-1.2, 1.2), ylim=c(-1.2, 1.2), uin, tol=0.04, right=FALSE, shrink=NULL, ...)

_A_r_g_u_m_e_n_t_s:

       x: a vector contains direction or a two columns data frame,
          where the first component is the direction and the second the
          magnitude.  The vector or the first column in the case of
          data frame is coerced to class 'circular'.

       y: a vector contains magnitude. If 'y' is not NULL and 'x' is a
          dataframe,  only the first column of 'x' is used for
          direction.

  breaks: the extremes of the pedals. The biggest value (in 2*pi) is
          recycled for building the first pedal. The vector is coerced
          to class 'circular' but only the units is used.

    bins: Number of pedals. Ignored if 'breaks' is not NULL.

increment: Grouping size of magnitude. These are the bins of the
          magnitudes displayed on each pedal.

    main: Title for plot.

 cir.ind: Percent intervals expressed on each circle if the pedals are
          equally spaced, otherwise values of density

fill.col: colors used to fill the pedals for each magnitude. The colors
          are recycled if necessary. The default is to use 'blue' and
          'red'.

plot.mids: plot lines at the midpoints of the pedals.

mids.size: length of the lines for midpoints.

   osize: radius of the circle draws at the center of the plot.

    axes: if TRUE axes are added to the plot. The function
          'axis.circular' is used.

   ticks: if TRUE ticks are added to the plot. The function
          'ticks.circular' is used.

     tcl: length of the ticks.

tcl.text: The position of the axis labels.

     cex: point character size.  See help on '\lonk{par}'.

  digits: number of digits used to print axis values and other numbers.

num.ticks: number of tick marks draw.

     tol: proportion of white space at the margins of plot

     uin: desired values for the units per inch parameter. If of length
          1, the desired units per inch on the x axis.

xlim, ylim: the ranges to be encompassed by the x and y axes. Useful
          for centering the plot.

   right: logical; if TRUE, the pedals are right-closed (left open)
          intervals.

  shrink: maximum length of the pedals, it can be used to plot several
          graphics with the same scale.

     ...: further parameters ignored for now.

_D_e_t_a_i_l_s:

     Following the convention of the National Weather Service, winds
     with a direction of 0 are considered calm, while winds with a
     direction of 360 degrees (2*pi radians) are assumed to be from the
     north.  Calm winds are excluded from the wind rose creation.

     This wind rose preserve areas of pedals, that is counts are
     proportional to the area of the pedals rather than to the length
     of the pedals. This is also for the slides created for the
     magnitudes.

_V_a_l_u_e:

       x: directions

       y: magnitudes

   table: Matrix output of the counts of wind direction and magnitude.
          Columns are in the same units as the data, according to step
          size, and rows are based on the increment size.

number.obs: Total number of observations.

number.calm: The number of calm observations omitted from the wind rose
          plot.

  breaks: extremes of the pedals.

    mids: midpoints of pedals.

    call: the 'match.call' result.

_N_o_t_e:

     some codes from 'eqscplot' in 'MASS' is used.

_A_u_t_h_o_r(_s):

     Matt Pocernich <pocernic@rap.ucar.edu>, ported in the package
     'circular' by Claudio Agostinelli

_E_x_a_m_p_l_e_s:

     # Random distribution of direction and magnitude in degrees

     dir <- circular(runif(100, 0, 360), units="degrees")
     mag <-  rgamma(100, 15)
     sample <- data.frame(dir=dir, mag=mag)

     par(mfrow=c(2,2))
     res <- windrose(sample)
     ## we join two pedals and keep the same shrink (scale of the plot)
     breaks <- seq(0, 2 * pi, by = pi/6)
     breaks <- breaks[-2]
     windrose(sample, breaks=breaks, main="The same but with two pedals joined", shrink=res$shrink)
     ## change the rotation
     sample <- data.frame(dir=circular(dir, units="degrees", rotation="clock"), mag=mag)
     windrose(sample, breaks=breaks, main="Change the rotation", shrink=res$shrink)
     ## use geographics template
     sample <- data.frame(dir=circular(dir, units="degrees", template="geographics"), mag=mag)
     windrose(sample, breaks=breaks, main="Use the template 'geographics'", shrink=res$shrink)

     x11()
     ## do the same plot but in radians
     dir <- conversion.circular(dir)
     windrose(x=dir, y=mag, xlim=c(-1.3, 1.3))
     x11()
     ## magnify some part of the plot
     windrose(x=dir, y=mag, xlim=c(0, 1.3))

