Learn R Programming

greed (version 0.6.1)

H: Compute the entropy of a discrete sample

Description

Compute the entropy of a discrete sample

Usage

H(cl)

Value

the entropy of the sample

Arguments

cl

vector of discrete labels

Examples

Run this code
cl <- sample(2, 500, replace = TRUE)
H(cl)

Run the code above in your browser using DataLab