Learn R Programming

tidyinftheo (version 0.2.1)

mutual_info_matrix: Mutual information Matrix

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

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

Run this code
# NOT RUN {
# make an all-character version of mtchars
mt_tib <- as_tibble(mtcars) %>% mutate_all(as.character)
mutual_info_matrix(mt_tib, 8:11)
# }

Run the code above in your browser using DataLab