Construct a 2-dimensional "discursive space" embedding given a distance matrix.
Usage
# S3 method for 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)
#> [2023-11-15 08:24:50.33582] starting umap
#> [2023-11-15 08:24:50.369645] creating graph of nearest neighbors
#> [2023-11-15 08:24:50.388917] creating initial embedding
#> [2023-11-15 08:24:50.398499] optimizing embedding
#> [2023-11-15 08:24:50.513047] done