annotate_archetypes: Annotate archetypes with custom labels

Description Usage Arguments Value Author(s) See Also Examples

View source: R/annotate_archetypes.R

Description

annotate_archetypes() adds custom labels to archetype indices: paste0(label, "_", index)

Usage

1

Arguments

...

named arguments specifying label for indicex, e.g. Epithelial = c(1, 5, 9)

arc_data

objects of class "pch_fit", "b_pch_fit", "k_pch_fit" storing the position of archetypes, and other data from fit_pch() run. arc_data$XC is matrix of dim(dimensions, archetypes) or list where each element is XC matrix from an independent run of the archetypal analysis.

Value

annotate_archetypes() archetypal analysis result object, the same as input but with named archetypes

Author(s)

Vitalii Kleshchevnikov

See Also

fit_pch, arch_dist

Examples

 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)

vitkl/ParetoTI documentation built on Feb. 11, 2020, 1:36 a.m.