Skip to content
Prev 366919 / 398506 Next

looping problem

Hello,

If what you want is to combine the files into one data.frame then there 
are 2 things you should see:

1) You create a variable named 'temp' and don't ever use it.
2) You never combine the data.frames you read in.

Try instead the following.

temp <- data.frame()
for(i in 1:22) {
     infile<-paste("chr",i,"/Z-score.imputed",sep="")
     psT<-read.table(infile,header=T,as.is=T,sep="\t")
     temp <- rbind(temp, psT)
}

str(temp)  # to see what you have

Hope this helps,

Rui Barradas



Em 01-02-2017 17:25, greg holly escreveu: