mutual_info_matrix: Mutual information Matrix

Description Usage Arguments Value Examples

View source: R/inftheo.R

Description

To simplify the task of comparing variables, this calculates a matrix of mutual information values from each pairwise combination of the variables selected. If 6 variables are selected, that would yield a table with 15 rows (choose(6,2)), and 3 columns.

Usage

1
mutual_info_matrix(.data, ..., normalized = FALSE, na.rm = FALSE)

Arguments

.data

A tibble with the columns of interest

...

a selection of columns, selected in the same way as select

normalized

if TRUE, scale from 0 to 1

na.rm

remove all rows with NA values in at least one of the columns

Value

a 3 column tibble with each pairwise combination and its calculated mutual information

Examples

1
2
3
# make an all-character version of mtchars
mt_tib <- as_tibble(mtcars) %>% mutate_all(as.character)
mutual_info_matrix(mt_tib, 8:11)

tidyinftheo documentation built on Dec. 1, 2017, 1:01 a.m.