scalefactor | R Documentation |
The function calculates the scaling factor so that after scaling the original density curve (before transformation), the total area after transformation (excluding the reference circle) has the specified value.
scalefactor(x, radius = 0, total.area = 1, area.prop = TRUE)
x |
a numeric vector storing the heights of a density curve or a histogram. |
radius |
the radius of the reference circle. |
total.area |
a positive number specifying the total area. |
area.prop |
logical; if |
Each value in x is a density value before transformation, for points
equally-spaced on [0,2π). For a smooth density curve, use a
reasonably large number of points, equally-spaced on [0,2π).
The area under the density curve after transformation is then approximated
by that of the corresponding sectors. Note if area.prop = TRUE
,
the scale factor is simply the value of total.area
.
A numerical value for the scaling factor
Danli Xu <dxu452@aucklanduni.ac.nz>, Yong Wang <yongwang@auckland.ac.nz>
Xu, D. and Wang, Y. (2020). Area-proportional Visualization for Circular Data. Journal of Computational and Graphical Statistics, 29, 351-357.
circtrans
dvm = function(x, mu=0, kappa=1) # von Mises density exp(kappa * cos(x - mu)) * (2 * pi * besselI(kappa, 0))^(-1) x = dvm(seq(0, 2 * pi, len = 100), pi, 10) scalefactor(x) # area-proportional transformation scalefactor(x, area.prop = FALSE) # height-proportional transformation scalefactor(x, total.area = 2) # total area of 2 scalefactor(x, area.prop = FALSE, total.area = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.