Learn R Programming

volker (version 3.2.0)

get_correlation: Calculate correlation between two vectors

Description

Calculate correlation between two vectors

Usage

get_correlation(x, y, method, category = NULL, test = TRUE)

Value

The result of cor.test() for metric vectors, chisq.test for Cramer's V.

Arguments

x

First vector

y

Second vector

method

One of "spearman" or "pearson" for metric vectors. For catecorical vectors, use "cramer" or "npmi".

category

A vector of values to focus. Necessary for the npmi method only.

test

Boolean; whether to perform significance tests.