circhelp is a small helper package for circular data
analyses in R, particularly useful for cognitive studies on orientation,
motion direction, and other circular features. The package contains
functions for descriptive statistics of circular data (computing means,
SD, and skewness), angular differences, and correlation. It also
includes a function to correct for cardinal biases in human estimates of
circular features (e.g., orientation). The documentation is available in
the package help files and at https://achetverikov.github.io/circhelp/.
You can install the latest released version from CRAN with:
install.packages("circhelp")The current developmental version from GitHub can be installed with:
# install.packages("devtools")
devtools::install_github("achetverikov/circhelp")Most functions are self-explanatory.
library(circhelp)
# compute a set of descriptive statistics
x <- rnorm(500)
circ_descr(x)
#> $mu
#> [1] 0.01289167
#>
#> $sigma
#> [1] 0.9319964
#>
#> $skew_pewsey
#> [1] -0.009480068
#>
#> $skew_fischer
#> [1] -0.06900768
#>
#> $rho
#> [1] 0.6477123
#>
#> $skew_rel_to_zero
#> [1] -0.004524587
# compute difference in orientations
a <- 5
b <- 170
angle_diff_180(a, b)
#> [1] 15
# compute difference in 360° space (e.g., motion directions)
angle_diff_360(a, b)
#> [1] -165
# compute correlation between angles
set.seed(1)
x <- rnorm(10000)
y <- 0.5 * x + sqrt(0.75) * rnorm(10000)
circ_corr(x, y)The only (somewhat) complicated function is
remove_cardinal_biases, see the help
files and the
vignette for an example use case.
