cor_matrix_kbl: cor_matrix_kbl

View source: R/cor_matrix_kbl.R

cor_matrix_kblR Documentation

cor_matrix_kbl

Description

This function creates a kable correlation matrix with colored cells indicating effect size and significance. Cells are darker green with increasing positive effect size and darker red with increasing negative effect size. Non-significant cells are not colored.

Usage

cor_matrix_kbl(
  dat,
  column_grid = NULL,
  alpha = 0.05,
  get_df = FALSE,
  round_digits = 3
)

Arguments

dat

dataframe: data

column_grid

dataframe: first two columns contain the names of pairwise variables found in dat

alpha

numeric: p-value cutoff at which to start coloring cells

Examples

data(mtcars)
size_columns <- c("hp", "wt")
power_columns <- c("hp", "qsec")
col_grid <- expand.grid(size_columns, power_columns)
cor_matrix_kbl(mtcars, col_grid)

amehtaSF/rsurveyutils documentation built on Aug. 27, 2022, 11:59 a.m.