Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tableC

Correlation Table


Description

Correlations printed in a nicely formatted table.

Usage

tableC(
  .data,
  ...,
  cor_type = "pearson",
  na.rm = FALSE,
  rounding = 3,
  output = "text",
  booktabs = TRUE,
  caption = NULL,
  align = NULL,
  float = "htb"
)

Arguments

.data

the data frame containing the variables

...

the unquoted variable names to be included in the correlations

cor_type

the correlation type; default is "pearson", other option is "spearman"

na.rm

logical (default is FALSE); if set to TRUE, the correlations use the "complete.obs" methods option from stats::cor()

rounding

the value passed to round for the output of both the correlation and p-value; default is 3

output

how the table is output; can be "text" for regular console output, "latex2" for specialized latex output, or any of kable()'s options from knitr (e.g., "latex", "markdown", "pandoc").

booktabs

when output != "text"; option is passed to knitr::kable

caption

when output != "text"; option is passed to knitr::kable

align

when output != "text"; option is passed to knitr::kable

float

when output == "latex2" it controls the floating parameter (h, t, b, H)

See Also

stats::cor


furniture

Furniture for Quantitative Scientists

v1.9.10
GPL-3
Authors
Tyson S. Barrett [aut, cre] (<https://orcid.org/0000-0002-2137-1391>), Emily Brignone [aut], Daniel J. Laxman [aut]
Initial release
2021-02-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.