Try this: X<-c("A","B","C","D","E") Y<-c(0,1,2,3,4)
for (i in 0:3) { Y<-Y+i data<-data.frame(X,Y) fe.flag <- file.exists("test.csv") write.table(data, "test.csv", row.names = FALSE, col.names = !fe.flag, sep=";", append = fe.flag) } [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.