I want to convert the multiple correlation matrix into dataframe at the same time
my matrix group like this: [
my current code is like this:
dat1 <- read.xlsx("correlation reshape.xlsx",sheet=1,rows=1:7,cols=2:8)#read studyid1-James2005
dat1
reshape_1<-as_cordf(dat1)#reshape the data into matrix
reshape_1
long.format1<-reshape_1 %>% gather(-rowname, key = "colname", value = "cor")#reshape the data into
na1<-na.omit(long.format1)#omit NA value
## psychmeta
dat2 <- read.xlsx("correlation reshape.xlsx", sheet=1,rows=8:11,cols=2:5,skipEmptyCols=TRUE)#read studyid2-Ashforth2010
reshape_2<-as_cordf(dat2)
long.format2<-reshape_2 %>% gather(-rowname, key = "colname", value = "cor")
long.format2
na2<-na.omit(long.format2)
#output method1
c <- rbind(na1,na2)#combine na1,na2..., and put them out.
write.table(c,"reshape_output.csv",sep=",")
my current method is to sperate the two correlation matrix, but i will have more than 1000 different correlation matrix, i want to know how to process them at the same time into the dataframe by pairs and add the ID as the first column? pls help