[R] looping problem

greg holly mak.hholly at gmail.com
Wed Feb 1 18:25:25 CET 2017


Hi all;

I have 22 directories named chr1, chr2,....,chr22. Each directory has a
file named "Z-score.imputed". I would like to combine  Z-score.imputed
files into one. I wrote the following loop but did not get any results.
Your helps are highly appreciated.

regards,

Greg

temp<-c()

for(i in 1:22) {
infile<-paste("chr",i,"/Z-score.imputed",sep="")
psT<-read.table(as.character(infile),header=T,as.is=T,sep="\t")
ps<-psT[psT$Var>0.6,]
ratio=nrow(ps)/nrow(psT)
print(ratio)
}

	[[alternative HTML version deleted]]



More information about the R-help mailing list