Just write the headers once and append as many times as needed? You can append as many datasets as you want.
--- On Wed, 12/16/09, rkevinbur...@charter.net <rkevinbur...@charter.net> wrote: > From: rkevinbur...@charter.net <rkevinbur...@charter.net> > Subject: Re: [R] write.csv and header > To: "Gustaf Rydevik" <gustaf.ryde...@gmail.com>, "Patrick Connolly" > <p_conno...@slingshot.co.nz> > Cc: r-help@r-project.org > Received: Wednesday, December 16, 2009, 3:05 PM > I have a small request regarding this > "append" feature. As it is now if the data is appended to > the file so is the header. I would like to have the header > only entered once and appends just append the data. > > Doable? > > Kevin > > ---- Patrick Connolly <p_conno...@slingshot.co.nz> > wrote: > > On Tue, 15-Dec-2009 at 01:55PM +0100, Gustaf Rydevik > wrote: > > > > > > |> Hi, > > |> > > |> ?write.table and the argument "append" should be > of help. > > |> example: > > |> > > |> > sink("test.csv") > > |> > cat("-----------------------------") > > |> > cat("\n") > > |> > cat("This is \n a test of header") > > |> > cat("\n") > > |> > cat("-----------------------------") > > |> > cat("\n") > > |> > sink() > > |> > > > > > Or, instead of the use of sink() and cat(), one could > use the write() > > function, also using the append = TRUE argument. > > > > > > |> > write.table(matrix(rnorm(100),nrow=10),file="test.csv",append=TRUE,sep=",") > > |> > > |> > > |> regards, > > |> Gustaf > > |> > > |> > > |> -- > > |> Gustaf Rydevik, M.Sci. > > |> tel: +46(0)703 051 451 > > |> address:Essingetorget 40,112 66 Stockholm, SE > > |> skype:gustaf_rydevik > > |> > > |> [[alternative HTML version > deleted]] > > |> > > |> ______________________________________________ > > |> R-help@r-project.org > mailing list > > |> 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. > > > > -- > > > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. > > ___ Patrick > Connolly > > {~._.~} > Great minds discuss > ideas > > _( Y )_ > Average minds discuss events > > (:_~*~_:) > Small minds discuss people > > (_)-(_) > > ..... Eleanor Roosevelt > > > > > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. > > > > ______________________________________________ > > R-help@r-project.org > mailing list > > 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. > > ______________________________________________ > R-help@r-project.org > mailing list > 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. > __________________________________________________________________ Be smarter than spam. See how smart SpamGuard is at giving ju ______________________________________________ R-help@r-project.org mailing list 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.