cmhist {cplots} | R Documentation |
Multi-class Stacked Circular Histogram and Rose Diagram
Description
Function cmhist
can be used to plot 2-dimensional
histograms and rose diagrams for circular data with multiple classes.
The histograms are stacked to avoid any overlap.
Usage
cmhist(
value,
class,
nbins = 36,
radius = 1/sqrt(base::pi),
area.prop = TRUE,
prob = TRUE,
proportion = FALSE,
total.area = 1,
nlabels = 4,
cols = NULL,
borders = NULL,
m = NA,
xlim = NULL,
ylim = NULL,
main = NULL,
type = c("null", "compass", "clock"),
x.legend = "bottomright",
y.legend = NULL
)
Arguments
value |
a numeric vector storing angular values between 0 and 2 pi, or an object that can be coerced to. |
class |
a character vector specifying the group the |
nbins |
the number of bins of the circular histogram. Internally, it is rounded to a multiple of 4. |
radius |
the radius of the reference circle. If |
area.prop |
logical; if |
prob |
logical; if |
proportion |
logical; if |
total.area |
a positive number specifying the total area under all the
histograms. If |
nlabels |
integer, for the number of levels to be plotted; if
|
cols |
the colors to fill the bars, with the same order as the class. |
borders |
the colors of the border around the bars. |
m |
the number of points within each bin to plot the circular histogram. The larger the number is, the smoother the plot looks. |
xlim |
numeric vectors of length 2, giving the x coordinates ranges. |
ylim |
numeric vectors of length 2, giving the y coordinates ranges. |
main |
the main title (on top) |
type |
the type of circular data, one of the values |
x.legend |
x coordinate to plot the legend. |
y.legend |
y coordinate to plot the legend. |
Value
No return value
Author(s)
Danli Xu <dxu452@aucklanduni.ac.nz>, Yong Wang <yongwang@auckland.ac.nz>
References
Xu, D. and Wang, Y. (2020). Area-proportional Visualization for Circular Data. Journal of Computational and Graphical Statistics, 29, 351-357.
See Also
Examples
# Load the dataset
library(circular)
data("pigeons", package = "circular")
x = pigeons[,2] / 180 * pi
y = pigeons[,1]
# stacked circular histograms
cmhist(x, y) # area-proportional
cmhist(x, y, area=FALSE) # height-proportional