So I am still an R newb so be gentle ;) I basically should be able to figure this out but I think frustration has set in. I wish to simply write three columns to a file using write.table (easy enough) but I also wish that it is appended via "\t" separator so my resulting file is a tab delimited txt file. I have attached my code which works fine but they are appended via rows so I would love to be able to solve this. Any pointers would be awesome!
Cheers
for(num in 0:10){
input<-paste("C:\\Users\\Desktop\\non-viewpoint 20-2-14\\HMEC(p9)\\Exp*_HMEC(p9)-IP",num,".txt",sep="")
files<-Sys.glob(input)
outfile<-paste("C:\\Users\\Desktop\\non-viewpoint 20-2-14\\exps_HMEC(p9)-IP",num,".txt",sep="")
exp1<-read.table(files[1],header=TRUE,sep="\t")
e1<-exp1[grep("9", exp1$Chromosome, invert=TRUE), ]
write.table(e1$Probe,row.names=FALSE,col.names=FALSE,quote=FALSE,append=TRUE,outfile)
exp2<-read.table(files[2],header=TRUE,sep="\t")
e2<-exp2[grep("9", exp2$Chromosome, invert=TRUE), ]
write.table(e2$Probe,row.names=FALSE,col.names=FALSE,quote=FALSE,append=TRUE,outfile)
exp3<-read.table(files[3],header=TRUE,sep="\t")
e3<-exp3[grep("9", exp3$Chromosome, invert=TRUE), ]
write.table(e3$Probe,row.names=FALSE,col.names=FALSE,quote=FALSE,append=TRUE,outfile)
}