Description Usage Arguments Value Author(s) See Also Examples
View source: R/annotate_archetypes.R
annotate_archetypes()
adds custom labels to archetype indices: paste0(label, "_", index)
1 | annotate_archetypes(arc, ...)
|
... |
named arguments specifying label for indicex, e.g. |
arc_data |
objects of class "pch_fit", "b_pch_fit", "k_pch_fit" storing the position of archetypes, and other data from |
annotate_archetypes()
archetypal analysis result object, the same as input but with named archetypes
Vitalii Kleshchevnikov
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Random data that fits into the triangle
set.seed(4355)
archetypes = generate_arc(arc_coord = list(c(5, 0), c(-10, 15), c(-30, -20)),
mean = 0, sd = 1)
data = generate_data(archetypes$XC, N_examples = 1e4, jiiter = 0.04, size = 0.9)
# Find 3 archetypes in this data
arc = fit_pch(data, noc=as.integer(3), delta=0)
# Annotate
arc = annotate_archetypes(arc, top = 2, bottom = c(1, 3))
# Plot
plot_arc(arc, data, which_dimensions = 1:2, arc_names_num = F)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.