Re: [R] Adding header lines to a dataframe that is exported using write.csv

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Mon 27 Feb 2006 - 22:32:20 EST

On 2/27/06 6:03 AM, "Henrik Bengtsson" <hb@maths.lth.se> wrote:

> Just a tips: When you add headers to tabulate files like yours, it is
> convenient to start each header line with a '#' (like an R comment),
> because then read.table() will not complain about the header lines.
> It is easy to strip the '#' off the header lines, i.e. grep("^#", "",
> hlines) before further parsing.

You can also use the skip argument to read.table() to skip an arbitrary number of lines of header information.

Sean



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Feb 27 22:43:40 2006

This archive was generated by hypermail 2.1.8 : Tue 28 Feb 2006 - 00:08:47 EST