correlation | R Documentation |
Sometimes, we need calculate the correlation of each sample of a matrix. This function can calculate the correlation among each sample of a matrix with metrics(pearson,spearman,cosin or euclidean) by parallel.
correlation(matrix, method = c("pearson", "spearman", "cosin", "euclidean"), cpu_num = 8)
matrix |
A matrix with column is sample, row is feature. |
method |
The metric to calculate the correlation. Four metrics("pearson", "spearman", "cosin", "euclidean") are supported. |
cpu_num |
The number of cpu used for parallel calculation. |
A matrix showing the correlation with column and row are both sample.
Bin Duan
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.