Learn R Programming

sams (version 0.4.3)

partitionEntropy: Calculate the Entropy of a Set Partition

Description

Calculate the Entropy of a Set Partition

Usage

partitionEntropy(partition)

Arguments

partition

A numeric vector representing a partition of the integers \(1\), ..., \(n\) using cluster labels

Value

Calculated partition entropy as a numeric vector of length one

Examples

Run this code
# NOT RUN {
p <- c(0,0,0,1,1,2) # n = 6, 3 unique clusters
partitionEntropy(p)
# }

Run the code above in your browser using DataLab