cdotplot {cplots} | R Documentation |
Circular Stacked Dot Plot
Description
Function cdotplot
can be used to plot 2-dimensional
stacked dot plot for circular data.
Usage
cdotplot(
x,
nbins = 36,
radius = 1,
unit = NA,
area.prop = TRUE,
total.area = 1,
m = NA,
col = "lightblue",
border = "skyblue4",
xlim = NULL,
ylim = NULL,
main = NULL,
x.legend = "bottomright",
y.legend = NULL
)
Arguments
x |
a circular data object that is fully defined by the user. |
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 |
unit |
the number of observations represented by each dot. If
|
area.prop |
logical; if |
total.area |
a positive number specifying the total area under the
density curve. If |
m |
the number of points within each bin to plot the circular dot plot. The larger the number is, the smoother the plot looks. |
col |
the color to fill the bars. |
border |
the color of the border around the bars. |
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) |
x.legend |
x coordinate to plot the legend. |
y.legend |
y coordinate to plot the legend. |
Details
If the number of observations is relatively small, the
usual circular stacked dot plot can be used with unit = 1
.
If the dataset is large, the dots may become too dense to
visualize or count. Setting unit
to be any positive
integer to allow each dot to represent more than one observation.
If the number of observations in one bin is not a multiple of the
specified unit, a partial dot can be used to represent the
remainder at the top of the bin.
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
# 30 observations from two von Mises distributions
library(circular)
x = c(rvonmises(10, circular(pi/4), 5), rvonmises(20, circular(pi), 20))
cdotplot(x) # area-proportional dot plot
cdotplot(x, area = FALSE) # height-proportional dot plot
# 900 observations from two von Mises distributions
y = c(rvonmises(300, circular(pi/4), 5), rvonmises(600, circular(pi), 20))
cdotplot(y, nbins=76, unit = 10) # area-proportional (partial) dot plot
cdotplot(y, nbins=76, unit = 10, area = FALSE) # height-proportional