scclust | R Documentation |
The scclust
function constructs a scclust
object from existing
cluster labels.
scclust(cluster_labels, unassigned_labels = NULL, ids = NULL)
cluster_labels |
a vector containing each data point's cluster label. |
unassigned_labels |
labels that denote unassigned data points. If |
ids |
IDs of the data points. Should be a vector of the same length as
|
scclust
does not derive clusters from sets of data points; see
sc_clustering
and hierarchical_clustering
for
that functionality.
Returns a scclust
object with the clustering described by the
provided labels.
# 10 data points in 3 clusters
my_scclust1 <- scclust(c("A", "A", "B", "C", "B",
"C", "C", "A", "B", "B"))
# 8 data points in 3 clusters, 2 points unassigned
my_scclust2 <- scclust(c(1, 1, 2, 3, 2,
NA, 3, 1, NA, 2))
# Custom labels indicating unassiged points
my_scclust3 <- scclust(c("A", "A", "B", "C", "NONE",
"C", "C", "NONE", "B", "B"),
unassigned_labels = "NONE")
# Two different labels indicating unassiged points
my_scclust4 <- scclust(c("A", "A", "B", "C", "NONE",
"C", "C", "0", "B", "B"),
unassigned_labels = c("NONE", "0"))
# Custom data point IDs
my_labels5 <- scclust(c("A", "A", "B", "C", "B",
"C", "C", "A", "B", "B"),
ids = letters[1:10])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.