R code to aggregate correlations