Given a correlation matrix and optionally the sample class information, calculates the median correlations of each sample to all other samples in the same class. May be useful for determining outliers.
Arguments
- cor_matrix
the sample - sample correlations
- sample_classes
the sample classes as a character or factor
- between_classes
should the between class correlations be evaluated?
Details
The data.frame may have 5 columns, first three are always present,
the second two come up if between_classes = TRUE
:
- med_cor
the median correlation with other samples
- sample_id
the sample id, either the rowname or an index
- sample_class
the class of the sample. If not provided, set to "C1"
- compare_class
the class of the other sample
- plot_class
sample_class::compare_class
for easy grouping