to_cormatrix: Convert a Correlation Vector to a Correlation Matrix

View source: R/to_cormatrix.R

to_cormatrixR Documentation

Convert a Correlation Vector to a Correlation Matrix

Description

The function to_cormatrix converts a correlation vector to a correlation matrix

Usage

to_cormatrix(cor_vec, n_dim)

Arguments

cor_vec

This is a correlation matrix that multiple pair-wise correlations in the arrangement of pairs i and j, where i = 1,...,n_dim - 1 and j = 2,...n_dim and n_dim is the number of dimensions.

n_dim

The number of dimensions or columns.

Value

to_cormatrix will return a n_dim x n_dim correlation matrix with 1 in the diagonal cells.

Examples

library(AUTTT)
to_cormatrix(cor_vec = c(0.3, 0.4, 0.5, 0.6, 0.42, 0.52), 
n_dim = 4)


Boklauth/AUTTT documentation built on Dec. 9, 2022, 7:37 a.m.