I would like to determine many correlations (millions) between pairs of columns, so I am worried about computing time.
I suspect that Pearson correlations (based on values) are faster to calculate in R than Spearman correlations (based on ranks). Is that correct?
How can I find out, please? Thank you.
You can use the
rbenchmark
package for this.1.000 rows, 100 repetitions
1.000.000 rows, 100 repititions
This confirms you assumption: Pearson is significantly faster than Spearman. Especially when the rows/cases are increased, Spearman becomes slow.