On Fri, 22 Aug 2008, Martin Ballaschk wrote:

Hi folks,

thank you for your friendly and immediate help!

Am 22.08.2008 um 17:14 schrieb Prof Brian Ripley:
Or, better, use header=FALSE, skip=1 and the col.names arg of read.table().

My solution is reading the files without the headers (skip = 1) and seperately reading the headers with scan (scan("myfile.CSV", what = "character", sep = "\t", nlines = 1). After throwing out the first two columns it should be possible to assign the scanned colnames to the data.frame colnames.

Yes, but if you read the header first you can set the col.names via the arg to read.table().

--
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
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.

Reply via email to