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

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

On 2/27/06 6:03 AM, "Henrik Bengtsson" <> 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 mailing list PLEASE do read the posting guide! 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