Construct a 2-dimensional "discursive space" embedding given a distance matrix.
Usage
# S3 method for class 'matrix'
umap(dist_mx, include_data = FALSE, df = TRUE, ...)Arguments
- dist_mx
Distance matrix
- include_data
By default, to save space the data (distance matrix) is not returned
- df
Return a tibble with columns
document,x, andy(default) or the output ofumap.- ...
Other parameters passed to
umap::umap()
Value
Object of class umap, with components layout (coordinates of items), knn (k-nearest neighbors matrices), config (UMAP configuration) or tidied dataframe, per argument df
Examples
gamma = rdirichlet(26, 1, 5)
rownames(gamma) = letters
h_gamma = hellinger(gamma)
embedded = umap(h_gamma, df = TRUE, verbose = TRUE)
#> [2026-03-22 13:08:28.814356] starting umap
#> [2026-03-22 13:08:28.825555] creating graph of nearest neighbors
#> [2026-03-22 13:08:28.83238] creating initial embedding
#> [2026-03-22 13:08:28.835728] optimizing embedding
#> [2026-03-22 13:08:28.860154] done