Learn R Programming

clue (version 0.2-11)

lattice: Partition Lattice

Description

Computations on the lattice of all (hard) partitions of a set of objects: meet and join.

Usage

cl_meet(x, y)
cl_join(x, y)

Arguments

x
an ensemble of partitions, or an R object representing a partition.
y
an R object representing a partition. Ignored if x is an ensemble of partitions.

Value

  • An object inheriting from class "cl_membership" with the memberships of the meet and join, respectively.

Details

For a given finite set of objects $X$, the set $H(X)$ of all (hard) partitions of $X$ can be partially ordered by defining a partition $P$ to be finer than a partition $Q$, i.e., $P \le Q$, if each class of $P$ is contained in some class of $P$. With this partial order, $H(X)$ becomes a bounded lattice, with intersection and union of two elements given by their greatest lower bound (meet) and their least upper bound (join), respectively.

Specifically, the meet of two partitions computed by cl_meet is the partition obtained by intersecting the classes of the partitions; the classes of the join computed by cl_join are obtained by joining all elements in the same class in at least one of the partitions. Obviously, the least and greatest elements of the partition lattice are the partitions where each object is in a single class (sometimes referred to as the splitter partition) or in the same class (the lumper partition), respectively. Meet and join of an arbitrary number of partitions can be defined recursively. If the partitions specified by x and y are soft partitions, the corresponding closest hard partitions are used. Future versions may optionally provide suitable soft (fuzzy) extensions for computing meets and joins.

Examples

Run this code
## Two simple partitions of 7 objects.
A <- as.cl_partition(c(1, 1, 2, 3, 3, 5, 5))
B <- as.cl_partition(c(1, 2, 2, 3, 4, 5, 5))
## These disagree on objects 1-3, A splits objects 4 and 5 into
## separate classes.  Objects 6 and 7 are always in the same class.
cl_meet(A, B)
cl_join(A, B)
## Meeting with the lumper (greatest) or joining with the splitter
## (least) partition does not make a difference: 
C_lumper <- as.cl_partition(rep(1, n_of_objects(A)))
cl_meet(cl_ensemble(A, B, C_lumper))
C_splitter <- as.cl_partition(seq(length = n_of_objects(A)))
cl_join(cl_ensemble(A, B, C_splitter))

Run the code above in your browser using DataLab