Learn R Programming

snazzieR (version 0.1.2)

eigen.summary: Summarize Eigenvalues and Eigenvectors of a Covariance Matrix

Description

This function computes the eigenvalues and eigenvectors of a given covariance matrix, ensures sign consistency in the eigenvectors, and outputs either a LaTeX table or plaintext summary displaying the results.

Usage

eigen.summary(
  cov.matrix,
  caption = "Eigenvectors of Covariance Matrix",
  latex = TRUE
)

Value

A LaTeX formatted table (if latex = TRUE) or plaintext console output (if latex = FALSE).

Arguments

cov.matrix

A square numeric matrix representing the covariance matrix.

caption

A character string specifying the table caption (default: "Eigenvectors of Covariance Matrix").

latex

A logical indicating whether to output LaTeX table (default: TRUE). If FALSE, prints as plain text.

Examples

Run this code
cov_matrix <- matrix(c(4, 2, 2, 3), nrow = 2)
eigen.summary(cov_matrix, caption = "Eigenvalues and Eigenvectors", latex = FALSE)

Run the code above in your browser using DataLab