matrixCorr
is a lightweight, high-performance package
for computing correlation matrices in R
. Numerically robust
estimates for:
Designed for large matrices and tie-heavy data,
matrixCorr
accepts matrices or data frames, returns
symmetric correlation matrices with metadata, and includes convenient
print()
and plot()
methods for quick
inspection.
Rcpp
kendall_tau()
function for matrices and
data frames# Install from GitHub
# install.packages("devtools")
::install_github("Prof-ThiagoOliveira/matrixCorr") devtools
library(matrixCorr)
# Simulated data
set.seed(42)
<- cbind(A = rnorm(100), B = rnorm(100), C = rnorm(100))
mat
# Compute Kendall's tau correlation matrix
<- kendall_tau(mat)
ktau
# Print matrix
print(ktau)
# Visualize with ggplot2
plot(ktau)
library(matrixCorr)
# Simulated data with some ties
set.seed(123)
<- cbind(
mat A = sample(1:10, 100, replace = TRUE),
B = sample(1:10, 100, replace = TRUE),
C = rnorm(100)
)
# Compute Spearman's rho correlation matrix
<- spearman_rho(mat)
spearman
# Print matrix
print(spearman)
# Visualize with ggplot2
plot(spearman)
library(matrixCorr)
# Simulated continuous data
set.seed(999)
<- cbind(
mat A = rnorm(100),
B = 0.5 * rnorm(100) + 0.5,
C = runif(100)
)
# Compute Pearson correlation matrix
<- pearson_corr(mat)
pcorr
# Print matrix
print(pcorr)
# Visualize with ggplot2
plot(pcorr)
See inst/LICENSE for the full MIT license text.