Skip to contents

Plots a rose diagram (rose of directions), the analogue of a histogram or density plot for angular data.

Usage

rose(
  x,
  weights = NULL,
  binwidth = NULL,
  bins = NULL,
  axial = TRUE,
  equal_area = TRUE,
  clockwise = TRUE,
  muci = TRUE,
  round_binwidth = 0,
  mtext = "N",
  main = NULL,
  sub = NULL,
  at = seq(0, 360 - 45, 45),
  col = "grey",
  dots = FALSE,
  dot_pch = 1,
  dot_cex = 1,
  dot_col = "grey",
  ...
)

Arguments

x

Data to be plotted. A numeric vector containing angles (in degrees).

weights

Optional vector of numeric weights associated with x.

binwidth

The width of the bins (in degrees).

bins

number of arcs to partition the circle width. Overridden by binwidth.

axial

Logical. Whether data are uniaxial (axial=FALSE) or biaxial (TRUE, the default).

equal_area

Logical. Whether the radii of the bins are proportional to the frequencies (equal_area=FALSE, i.e. equal-angle) or proportional to the square-root of the frequencies (equal_area=TRUE, the default).

clockwise

Logical. Whether angles increase in the clockwise direction (clockwise=TRUE, the default) or anti-clockwise, counter-clockwise direction (FALSE).

muci

logical. Whether the mean and its 95% CI are added to the plot or not.

round_binwidth

integer. Number of decimal places of bin width (0 by default).

mtext

character. String to be drawn at the top margin of the plot ("N" by default)

main, sub

Character string specifying the title and subtitle of the plot. If sub = NULL, it will show the bin width.

at

Optional vector of angles at which tick marks should be plotted. Set at=numeric(0) to suppress tick marks.

col

fill color of bins

dots

logical. Whether a circular dot plot should be added (FALSE is the default).

dot_cex, dot_pch, dot_col

Plotting arguments for circular dot plot

...

Additional arguments passed to spatstat.explore::rose().

Value

A window (class "owin") containing the plotted region.

Note

If bins and binwidth are NULL, an optimal bin width will be calculated using Scott (1979): $$ w_b = \frac{R}{n^{\frac{1}{3}}} $$ with n being the length of x, and the range R being either 180 or 360 degree for axial or directional data, respectively.

If "axial" == TRUE, the binwidth is adjusted to guarantee symmetrical fans.

Examples

x <- rvm(100, mean = 90, k = 5)
rose(x, axial = FALSE, border = TRUE)


data("san_andreas")
rose(san_andreas$azi, dots = TRUE, main = "dot plot")

rose(san_andreas$azi, weights = 1 / san_andreas$unc, main = "weighted")