title: Loop for doing multiple correlations on dataset in R
body: <p>I have a dataset with x number of columns, consisting of groups of test results, for example test1_1, test1_2 etc.  Each set of tests has a different number of test results associated with it so the actual numbers aren't the same across each test.  The final column is my target variable.  I'm looking to establish which tests are correlated with the target variable, but I also want to create datasets for each set of tests.  I'm also going to be plotting correlation plots of each test against the target variable.  I suspect I could probably achieve all of this in a few lines of code within a for/while loop, however, I'm not sure where to begin.</p>