powered by
Correlation and covariance calculation for sparse matrix
pearson_correlation(x, y = NULL)
A list with covariance and correlation matrices.
Sparse matrix or character vector.
m1 <- simulate_sparse_matrix( 100, 100 ) m2 <- simulate_sparse_matrix( 100, 100, sparsity = 0.05 ) a <- pearson_correlation(m1, m2) a$cov[1:5, 1:5] a$cor[1:5, 1:5]
Run the code above in your browser using DataLab