Implements discrete curvature estimation for ordered planar point
sequences using circumcenter geometry on consecutive triplets, exposed
through compiled C plus plus (C++) code via 'Rcpp' for speed and numerical
robustness. The package is useful for objective elbow detection in
multivariate workflows, especially principal component analysis (PCA), where
selecting the number of retained components can be subjective. It provides a
'shiny' interface that supports upload of raw datasets or explained-variance
tables, computes Kaiser-Meyer-Olkin (KMO) sampling-adequacy diagnostics,
evaluates individual and cumulative variance curves, and reports curvature-
based decision rules (m* and m**) with visual summaries for reproducible
component-selection decisions.
References: Arney et al. (2001); Axler
(2024)
Dcurvature provides a fast C++/Rcpp implementation of discrete curvature on
ordered 2D curves, plus a Shiny app for PCA component selection using
curvature-based elbow detection.
# install.packages("remotes")
remotes::install_local("path/to/Dcurvature")
library(Dcurvature)
pts <- cbind(
x = seq(0, 1, length.out = 12),
y = sin(seq(0, pi, length.out = 12))
)
kappa <- curvature(pts)
head(kappa)
x <- load_example_data()
str(x)
if (interactive()) {
run_curvature_app()
}