Description Usage Arguments Value See Also Examples
check_clustering
checks whether a clustering satisfies constraints on
the size and composition of the clusters.
1 2 3  check_clustering(clustering, size_constraint = NULL,
type_labels = NULL, type_constraints = NULL,
primary_data_points = NULL)

clustering 
a 
size_constraint 
an integer with the required minimum cluster size. If 
type_labels 
a vector containing the type of each data point. May be 
type_constraints 
a named integer vector containing typespecific size constraints. If

primary_data_points 
a vector specifying primary data points, either by point indices or with
a logical vector of length equal to the number of points.

Returns TRUE
if clustering
satisfies the constraints, and
FALSE
if it does not. Throws an error if clustering
is an
invalid instance of the scclust
class.
See sc_clustering
for details on how to specify the
type_labels
and type_constraints
parameters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43  # Example scclust clustering
my_scclust < scclust(c("A", "A", "B", "C", "B",
"C", "C", "A", "B", "B"))
# Check so each cluster contains at least two data points
check_clustering(my_scclust, 2)
# > TRUE
# Check so each cluster contains at least four data points
check_clustering(my_scclust, 4)
# > FALSE
# Data point types
my_types < factor(c("x", "y", "y", "z", "z",
"x", "y", "z", "x", "x"))
# Check so each cluster contains at least one point of each type
check_clustering(my_scclust,
NULL,
my_types,
c("x" = 1, "y" = 1, "z" = 1))
# > TRUE
# Check so each cluster contains one data point of both "x" and "z"
# and at least three points in total
check_clustering(my_scclust,
3,
my_types,
c("x" = 1, "z" = 1))
# > TRUE
# Check so each cluster contains five data points of type "y"
check_clustering(my_scclust,
NULL,
my_types,
c("y" = 5))
# > FALSE

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.