sym_mat2df | R Documentation |
Convert symmetrical matrix to long dataframe. Helpful for correlation or distance matrices
sym_mat2df(mat)
mat |
symmetrical matrix |
long dataframe with columns x, y, and value
# load example data
data(dss_example)
# subset features, features in columns
feat_mat <- dss_example$merged_abundance_id[1:6,2:26]
rownames(feat_mat) <- dss_example$merged_abundance_id[1:6,1]
feat_mat <- t(feat_mat)
# correlation matrix
corr_result <- cor(feat_mat)
sym_mat2df(corr_result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.