[R] a question on write.table

Giorgio Garziano giorgio.garziano at ericsson.com
Mon Sep 28 20:52:06 CEST 2015


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]]



More information about the R-help mailing list