prepCorrTable: LATEX/RMARKDOWN CORRELATION TABLES

View source: R/prepCorrTable.R

prepCorrTableR Documentation

LATEX/RMARKDOWN CORRELATION TABLES

Description

function to make a nice correlation table for latex/Rmd usage example: pTable <- rcorr() tabl <- prepCorrTable(DT) %>% xtable::xtable(.) print(tabl, type = "html. Adapted from http://myowelt.blogspot.com/2008/04/beautiful-correlation-tables-in-r.html

Usage

prepCorrTable(x = NULL, corTable = NULL, pTable = NULL, method = "pearson")

Arguments

x

a matrix or any object compatible with as.matrix, from where the covariance matrix will be calculated. alternatively, corTable and pTable matrices can be supplied.

corTable

matrix of correlation values obtained from e.g. Hmisc::rcorr(...)$r. If supplied, x will be ignored

pTable

matrix of pTable-values values obtained from e.g. Hmisc::rcorr(...)$pTable

method

see Hmisc::rcorr() type argument.


CeresBarros/ToolsCB documentation built on Aug. 23, 2024, 4:22 p.m.