Learn R Programming

partitionComparison (version 0.2.3)

Partition-class: Simple S4 class to represent a partition of objects as vector of class labels.

Description

This class is a wrapper around a vector but allows only the atomic vectors logical, numeric, integer, complex, character, raw. The reason for this is that only those types seem to make sense as class labels. Furthermore, class labels are immutable.

Arguments

Examples

Run this code
# NOT RUN {
p <- new("Partition", c(0, 0, 1, 1, 1))
q <- new("Partition", c("a", "a", "b", "b", "b"))

# }
# NOT RUN {
# This won't work:
new("Partition", c(list("a"), "a", "b", "b", "b"))
p[2] <- 2
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab