exp2cor | R Documentation |
Calculate pairwise correlations between genes in a matrix
exp2cor(exp, cor_method = "pearson")
exp |
A numeric matrix containing a gene expression matrix, with genes in rows and samples in columns. |
cor_method |
Character indicating the correlation method to use. One of "pearson", "spearman", or "biweight". Default: "pearson". |
A numeric, symmetric matrix with pairwise correlations between genes.
# Simulate an expression matrix with 100 genes and 50 samples
exp <- matrix(
rnorm(100 * 50, mean = 10, sd = 2),
nrow = 100,
dimnames = list(
paste0("gene", seq_len(100)),
paste0("sample", seq_len(50))
)
)
# Calculate correlation matrix
cor_mat <- exp2cor(exp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.