Learn R Programming

partitionComparison (version 0.2.5)

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

Author

Fabian Ball fabian.ball@kit.edu

Examples

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

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

Run the code above in your browser using DataLab