scalefactor: Scaling Factor

Description Usage Arguments Details Author(s) References See Also Examples

Description

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.

Usage

1
scalefactor(x, radius = 0, total.area = 1, area.prop = TRUE)

Arguments

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 TRUE, an area-proportional transformation is applied; if FALSE, a height-proportional transformationis applied.

Details

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.

Author(s)

Danli Xu <dxu452@aucklanduni.ac.nz>, Yong Wang <yongwang@auckland.ac.nz>

References

Xu, D. and Wang, Y. (2019) Area-proportional Visualization for Circular Data (submitted).

See Also

circtrans

Examples

1
2
3
4
5
6
7
8
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)

cplots documentation built on May 2, 2019, 12:19 p.m.

Related to scalefactor in cplots...