I have 2 data frames w/ 5 columns and 100 rows each.
id price1 price2 price3 price4 price5
1 11.22 25.33 66.47 53.76 77.42
2 33.56 33.77 44.77 34.55 57.42
...
I would like to get the correlation of the corresponding rows, basically
for(i in 1:100){
cor(df1[i, 1:5], df2[i, 1:5])
}
but without using a for-loop. I'm assuming there's someway to use plyr
to do it but can't seem to get it right. Any suggestions?