Calculates correlations between each pair of observations within each class. The correlation between an observation and itself is ignored.
The default correlation is the Pearson product moment correlation. If method
is 'spearman', then the Spearman's rank correlation is used, which is the Pearson correlation calculated using the ranks of the data.
Correlations are calculated class-wise on the matrix of observations of each class separately. Therefore, missing values may be handled differently for different classes.