print_cortest: Printing the results of a significance test for a correlation...

View source: R/print_cor.R

print_cortestR Documentation

Description

Printing the results of a significance test for a correlation coefficient

Usage

print_cortest(cor_object, decimals = 2, decimals_p = 3)

Arguments

cor_object

An object of class "htest" returned by cor.test

decimals

How many decimals should be printed for the test statistic (defaults to 2).

decimals_p

How many decimals should be printed for the p value (defaults to 3).

Value

A string describing the significance test; to be included in an R markdown document.

Author(s)

Martin Papenberg martin.papenberg@hhu.de

Examples


x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
y <- c( 2.6,  3.1,  2.5,  5.0,  3.6,  4.0,  5.2,  2.8,  3.8)
cor_results <- cor.test(x, y)
print_cortest(cor_results)


m-Py/prmisc documentation built on March 29, 2025, 2:30 p.m.