Entering edit mode
5.3 years ago
julrodr80
•
0
I need to do a loop with several conditions (create three diferent objects several times) and with a loop nested. I write this:
`metaxcan <- c("foo1.csv", "foo2.csv")`
`predix_asso <- c("soo1.csv", "soo2.csv")`
`for (i in metaxcan){`
`for (j in predix_asso){`
`PGC<-read.csv(i, header=T, sep=",")`
`asociacion<-read.table(j, header=T, sep="") `
`PGC_predix <- merge(PGC,asociacion,by="gene")`
`ngenes<-nrow(PGC_predix_1) `
`print(ngenes)`
`}`
`}`
But instead of print just 2 numbers (the merge between foo1 and soo1; and the merge of foo2 and soo2), it prints 4 numbers (all interactions)
How can I do? thanks