Why am I getting different results for Pearson and Spearman correlation, although I am already comparing ranks?
a <- c(1,2,3,1,2,3) b <- c(1,2,2,1,2,3) cor(a, b, method="pearson") #  0.8911328 cor(a, b, method="spearman") #  0.9036961
Formula to use when there are tied ranks seems identical to formula for pearson correlation.
As far as I understand, spearman correlation is just pearson correlation on the ranks. Right?