yaap

yaap is Yet Another Archetypes Package: a practical, matrix-first R toolkit that brings together many variants and flavors of archetypal analysis in one place. Some of these workflows are currently scattered across different packages, while others have had little or no R implementation available.

The package centers on a shared run_aa() interface for fitting, inspecting, comparing, plotting, and reusing archetypal analysis models. It supports multivariate, functional, non-Gaussian, kernel, and directional AA, plus direct solver wrappers when you want more control.

Installation 🛠️

yaap is currently under revision and may not yet be available on CRAN. For now, install the development version from GitHub:

# install.packages("pak")
pak::pak("teosakel/yaap")

Once released on CRAN, installation will be:

install.packages("yaap")

Quick Start 🚀

The core workflow is matrix-based: rows are samples, columns are features, and archetypes are fitted as extreme profiles in the convex hull of the data.

library(yaap)

X <- as.matrix(iris[, 1:4])  # numeric columns

fit <- run_aa(X, K = 3, nrep = 5, scale = TRUE)

coordinates(fit)          # K x features: the archetype profiles
compositions(fit)[1:6, ]  # samples x K: each sample's archetype mixture

plot(fit, what = "profiles")
generics::glance(fit)

You can also fit by formula when that is more convenient:

fit_iris <- run_aa(Species ~ ., data = iris, K = 3, scale = TRUE)

What Can yaap Do? 🧰

Vignette Tour 🗺️

The README is only the map. The vignettes are the snacks.

Methods and References 📚

yaap keeps the references close to the features they support:

mirror server hosted at Truenetwork, Russian Federation.