|
1 | 1 | #' @include cfDataList.R
|
2 | 2 | NULL
|
3 | 3 |
|
4 |
| -#' Plot a windrose |
| 4 | +#' Plot a Wind Rose |
5 | 5 | #'
|
6 |
| -#' Plot a windrose showing the wind speed and direction for given facets using |
| 6 | +#' Plot a wind rose showing the wind speed and direction for given facets using |
7 | 7 | #' \pkg{ggplot2}.
|
8 | 8 | #'
|
9 | 9 | #' This is intended to be used as a stand-alone function for any wind dataset. A
|
10 |
| -#' different windrose is plotted for each level of the faceting variable which |
| 10 | +#' different wind rose is plotted for each level of the faceting variable which |
11 | 11 | #' is coerced to a factor if necessary. The facets will generally be the station
|
12 | 12 | #' where the data were collected, seasons or dates. Currently only one faceting
|
13 | 13 | #' variable is allowed and is passed to \code{\link[ggplot2]{facet_wrap}} with
|
14 | 14 | #' the formula \code{~facet}.
|
| 15 | +#' |
| 16 | +#' Note that calm winds are excluded from the wind rose. |
15 | 17 | #'
|
16 | 18 | #' @section Theme Selection:
|
17 |
| -#' For black and white windroses that may be preferred if plots are to be used |
| 19 | +#' For black and white wind roses that may be preferred if plots are to be used |
18 | 20 | #' in journal articles for example, recommended \code{ggtheme}s are \code{'bw'},
|
19 | 21 | #' \code{'linedraw'}, \code{'minimal'} or \code{'classic'} and
|
20 | 22 | #' the \code{col_pal} should be \code{'Greys'}. Otherwise, any of the sequential
|
|
26 | 28 | #' @param speed numeric vector of wind speeds.
|
27 | 29 | #' @param direction numeric vector of wind directions.
|
28 | 30 | #' @param facet character or factor vector of the facets used to plot the various
|
29 |
| -#' windroses. |
| 31 | +#' wind roses. |
30 | 32 | #' @param n_directions the number of direction bins to plot (petals on the rose).
|
31 | 33 | #' The number of directions defaults to 12.
|
32 | 34 | #' @param n_speeds the number of equally spaced wind speed bins to plot. This is
|
33 | 35 | #' used if \code{speed_cuts} is \code{NA} (default 5).
|
34 | 36 | #' @param speed_cuts numeric vector containing the cut points for the wind speed
|
35 |
| -#' intervals, or \code{NA} (default). |
36 |
| -#' @param calm_wind the upper limit for wind speed that is considered calm |
37 |
| -#' (default 0). |
| 37 | + #' intervals, or \code{NA} (default). |
| 38 | +#' @param calm_wind the direction of wind that is considered calm. Following |
| 39 | +#' convention of the National Weather Service, winds with a |
| 40 | +#' direction of 0 are considered calm by default. |
38 | 41 | #' @param variable_wind numeric code for variable winds (if applicable).
|
39 | 42 | #' @param legend_title character string to be used for the legend title.
|
40 | 43 | #' @param col_pal character string indicating the name of the
|
|
59 | 62 | #' station = rep(rep(c("Station A", "Station B"), 2),
|
60 | 63 | #' rep(c(40, 10), each = 2)))
|
61 | 64 | #'
|
62 |
| -#' # Plot a simple windrose using all the defaults, ignoring any facet variable |
| 65 | +#' # Plot a simple wind rose using all the defaults, ignoring any facet variable |
63 | 66 | #' with(wind_df, windrose(wind_speeds, wind_dirs))
|
64 | 67 | #'
|
65 | 68 | #' # Create custom speed bins, add a legend title, and change to a B&W theme
|
|
0 commit comments