I am using R-Studio the latest version.
I have created a bunch of data frames that I would like to test for correlation. After creating the data frames I created a variable u
that denotes the universe of all the data frames. I would like to create a loop that will go through each data.frame
in u
and do the following test corr(data.frame)
I have the following code:
corrvals <- NULL
for (i in seq(along=u[])) {
corrvals <- corr(u)
}
I found something sort of along the lines of what I want to do here
The thing is, all the data.frame
's are setup exactly how I want them, and I simply would like to run though every data.frame
in the list and run the corr
function on it.
I would also like to print out the name of the data.frame and its correlation value, as so:
data.frame Corr
ac -0.03445345
af 0.023429
.
.
.
n corr(n)
into my empty storage container corrvals
.
Thank You