New to R and programming, but working on this skill to work through very large data sets. For this exercise, I would like to perform rank correlations between two types of samples for multiple analytes (>50) at various timepoints (i.e. baseline, month 1). I can work through it manually, each analyte and timepoint one by one, but it would awesome if I could get some support to automate to compare analytes in each tissues at the various timepoint. Finally, I would like to generate a data table that lists all the correlations by rank. Any help would be much appreciated. I have included images of the data frame and some of my code below.
Here is an example of the table:
Here is some of my code to get correlation for one analyte (IL-8):