I have 82 .csv files, each of them a zoo object, with the following format:
"Index", "code", "pp"
1951-01-01, 2030, 22.9
1951-01-02, 2030, 0.5
1951-01-03, 2030, 0.0
I want to do a correlation matrix between the pp of all of my files. I found out how to do it "manually" between two files:
zz<-merge(x,y, all = FALSE)
z<-cbind(zz[,2], zz[,4])
cor(z,use= "complete.obs")
but I can't come up with a loop to do it for all the files... a few things to consider: each file starts and ends at different dates and I would like the matrix to show the codes so I can identify who is who.
Can anyone help?