I have a great result of the correlation matrix in R - at the moment there are about 30 elements correlated against each other, so the array has about 10,000 cells. I want to find the biggest 5 and smallest 5 results. How can i do this?
Here, what small part - the upper left corner - looks like this:
PL1 V3 V4 V5 PL1 1.00000000 0.19905701 -0.02994034 -0.1533846 V3 0.19905701 1.00000000 0.09036472 0.1306054 V4 -0.02994034 0.09036472 1.00000000 0.1848030 V5 -0.15338465 0.13060539 0.18480296 1.0000000
The values ββin the table are always between 1 and -1, and if that helps, being a correlation matrix, the upper half above the diagonal is a duplicate of the lower half below the diagonal.
I need the most positive 5 less than 1 and the most negative 5, including -1 if it exists.
Thanks in advance.
source share