R code for corrrelation data prep, analysis, and structuring output