Description Usage Arguments Value See Also Examples
This calculates conditional shannon entropy of two columns in a tibble. It's assumed these columns are character typed with no NAs.
1 | shannon_cond_entropy(.data, ..., na.rm = FALSE)
|
.data |
A tibble with the columns of interest |
... |
two columns (variables) selected (order is important) |
na.rm |
remove all rows with NA values in at least one of the columns |
a double with the calculated value
shannon_entropy
1 2 3 4 5 6 | # make an all-character version of mtchars
mt_tib <- as_tibble(mtcars) %>% mutate_all(as.character)
shannon_cond_entropy(mt_tib, vs, am)
shannon_cond_entropy(mt_tib, 'vs', 'am')
shannon_cond_entropy(mt_tib, starts_with('c'))
shannon_cond_entropy(mt_tib, 9:8)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.