reltable: Convert a correlation matrix to a table of relations

Description Usage Arguments Details Value Examples

Description

reltable creates a sorted table of the relations of a correlation matrix. Relations with a correlation value of zero and autocorrelations get removed. reltable can consume a lot of time for big datasets!

Usage

1
reltable(corrtable, corrtable2 = data.frame())

Arguments

corrtable

correlation matrix (as produced by varnastats::corrmat())

corrtable2

optional second corrmatrix correlation matrix (as produced by varnastats::corrmat())

Details

Structure of the resulting table:

column 1 + 2: indezes of the variables/objects in the correlation matrix

column 3: correlation value

column 4 + 5: names of the variables/objects

column 6: optional second correlation value

Value

table of relations and their correlation value

Examples

1
2
3
4
5
6
7
8
9
testmatrixrand <- data.frame(
   matrix(base::sample(0:1,400,replace=TRUE), nrow=20, ncol=20)
)

testcorr <- corrmat(testmatrixrand, "lambda", dim = 1)
testcorr2 <- corrmat(testmatrixrand, "chi2", chi2limit = 0.1, dim = 1)

reltable(testcorr)
reltable(testcorr, testcorr2)

nevrome/varnastats documentation built on May 9, 2019, 10:43 a.m.