cor_sparse: Find the Pearson correlation of a sparse matrix efficiently

View source: R/cor_sparse.R

cor_sparseR Documentation

Find the Pearson correlation of a sparse matrix efficiently

Description

Find the Pearson correlation of a sparse matrix. For large sparse matrix this is more efficient in time and memory than cor(as.matrix(x)). Note that it does not currently work on simple_triplet_matrix objects.

Usage

cor_sparse(x)

Arguments

x

A matrix, potentially a sparse matrix such as a "dgTMatrix" object

Source

This code comes from mike on this Stack Overflow answer: https://stackoverflow.com/a/9626089/712603.


widyr documentation built on Sept. 13, 2022, 9:05 a.m.