Learn R Programming

DPI (version 2025.11)

cor_matrix: Produce a symmetric correlation matrix from values.

Description

Produce a symmetric correlation matrix from values.

Usage

cor_matrix(...)

Value

Return a symmetric correlation matrix.

Arguments

...

Correlation values to transform into the symmetric correlation matrix (by row).

Examples

Run this code
cor_matrix(
  1.0, 0.7, 0.3,
  0.7, 1.0, 0.5,
  0.3, 0.5, 1.0
)

cor_matrix(
  1.0, NA, NA,
  0.7, 1.0, NA,
  0.3, 0.5, 1.0
)

Run the code above in your browser using DataLab