cor_test: Correlation tests

Description Usage Arguments Value Examples

View source: R/cor_test.R

Description

A wrapper for cor.test that returns data in a data.frame rather than a cumbersome list

Usage

1
cor_test(var1, var2, method = NULL, round = TRUE)

Arguments

var1

a vector to correlate with var2

var2

a vector to correlate with var1

method

the correlation method to use, either pearson, spearman, or kendall

round

logical, whether or not to round the results

Value

Returns a data.frame version of the standard htest output. Use intended for presentation of data because numbers are converted to character and then back to numeric, trimming each values length and costing you precision.

Examples

1
cor_test(sample(1:100, 100), sample(1:100, 100), method = "pearson")

dtables documentation built on May 1, 2019, 6:48 p.m.