cortestR: Correlations with significance

Description Usage Arguments Value Examples

View source: R/tests.R

Description

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

Usage

1
2
3
4
5
6
7
8
9
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

1
2
3
4
# 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 May 8, 2021, 9:06 a.m.