Fast, optimal, and reproducible univariate
 clustering by dynamic programming. Four problems are solved, including
 univariate k-means (Wang & Song 2011) <doi:10.32614/RJ-2011-015>
 (Song & Zhong 2020) <doi:10.1093/bioinformatics/btaa613>, k-median,
 k-segments, and multi-channel weighted k-means. Dynamic programming
 is used to minimize the sum of (weighted) within-cluster distances
 using respective metrics. It substantially outperforms heuristic
 clustering in both efficiency and accuracy as the number of clusters
 increases. Multi-channel weighted k-means groups multiple univariate
 signals into k clusters. An auxiliary function generates histograms
 adaptive to patterns in data. This package provides a powerful set
 of tools for univariate data analysis with guaranteed optimality,
 efficiency, and reproducibility, useful for peak calling on temporal,
 spatial, and spectral data in addition to univariate clustering.

Implements the 'CKNNRLD' algorithm (Clustering-Based K-Nearest
    Neighbor Regression for Longitudinal Data) for improving K-Nearest
    Neighbor ('KNN') regression on longitudinal data through cluster-based
    partitioning and localized prediction. Offers enhanced computational
    efficiency and accuracy for high-volume longitudinal datasets. The
    acronym 'KNN' stands for K-Nearest Neighbor. References: Loeloe MS,
    Tabatabaei SM, Sefidkar R, Mehrparvar AH, Jambarsang S (2025).
    "Boosting K-nearest neighbor regression performance for longitudinal
    data through a novel learning approach." BMC Bioinformatics, 26, 232.
    <doi:10.1186/s12859-025-06205-1>.

Implements 'Markowitz' Critical Line Algorithm ('CLA') for classical
  mean-variance portfolio optimization, see Markowitz (1952) <doi:10.2307/2975974>.
  Care has been taken for correctness in light of previous buggy implementations.

Various cladogenesis-related calculations that are slow in pure R are implemented in C++ with Rcpp. These include the calculation of the probability of various scenarios for the inheritance of geographic range at the divergence events on a phylogenetic tree, and other calculations necessary for models which are not continuous-time markov chains (CTMC), but where change instead occurs instantaneously at speciation events.  Typically these models must assess the probability of every possible combination of (ancestor state, left descendent state, right descendent state).  This means that there are up to (# of states)^3 combinations to investigate, and in biogeographical models, there can easily be hundreds of states, so calculation time becomes an issue.  C++ implementation plus clever tricks (many combinations can be eliminated a priori) can greatly speed the computation time over naive R implementations.  CITATION INFO: This package is the result of my Ph.D. research, please cite the package if you use it!  Type: citation(package="cladoRcpp") to get the citation information.