cortestR: Correlations with significance

View source: R/tests.R

cortestRR Documentation

Correlations with significance

Description

cortestR computes correlations and their significance level based on cor.test. Coefficients and p-values may be combined or reported separately.

Usage

cortestR(
  cordata,
  method = "pearson",
  digits = 3,
  digits_p = 3,
  sign_symbol = TRUE,
  split = FALSE,
  space = ""
)

Arguments

cordata

data frame or matrix with rawdata.

method

as in cor.test.

digits

rounding level for estimate.

digits_p

rounding level for p value.

sign_symbol

If true, use significance indicator instead of p-value.

split

logical, report correlation and p combined (default) or split in list.

space

character to fill empty upper triangle.

Value

Depending on parameters split and sign_symbol, either a single data frame with coefficient and p-values or significance symbols or a list with two data frames.

Examples

# with defaults
cortestR(mtcars[, c("wt", "mpg", "qsec")], split = FALSE, sign_symbol = TRUE)
# separate coefficients and p-values
cortestR(mtcars[, c("wt", "mpg", "qsec")], split = TRUE, sign_symbol = FALSE)

wrappedtools documentation built on Sept. 24, 2023, 5:06 p.m.