Rdocumentation
powered by
Learn R Programming
rockchalk (version 1.6.2)
summary.factor: Tabulates observed values and calculates entropy
Description
This adapts code from R base summary.factor. It adds the calculation of entropy as a measure of diversity.
Usage
summary.factor(y, maxLevels = 5, sumstat = TRUE)
Arguments
y
a factor (non-numeric variable)
maxLevels
The maximum number of levels that will be presented in the tabulation.
sumstat
If TRUE (default), entropy (diversity) estimate and the number of NAs will be returned.
Value
a vector of named elements including the summary table as well as entropy and normed entropy.