Re: [R] read.table

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Tue 14 Feb 2006 - 12:11:50 EST

You can do it manually by reading in the headers separately:

headers <- read.table(test, header = FALSE, nrow = 1, sep = ";", as.is = TRUE) read.table(test, header = FALSE, skip = 1, sep = ";", col.names = headers)

On 2/13/06, Diethelm Wuertz <wuertz@itp.phys.ethz.ch> wrote:
>
>
> I have a file named "test.csv" with the following 3 lines:
>
> %y-%m-%d;VALUE
> 1999-01-01;100
> 2000-12-31;999
>
>
> > read.table("test.csv", header = TRUE, sep = ";")
>
> delivers:
>
> X.y..m..d VALUE
> 1 1999-01-01 100
> 2 2000-12-31 999
>
>
> I would like to see the following ...
>
> %y-%m-%d VALUE
> 1 1999-01-01 100
> 2 2000-12-31 999
>
>
> Note,
>
> > readLines("test.csv", 1)
>
> delivers
>
> [1] "%y-%m-%d;VALUE"
>
>
> Is this possible ???
>
>
> Thanks DW
>
> ______________________________________________
> 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
>



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 Tue Feb 14 12:22:18 2006

This archive was generated by hypermail 2.1.8 : Wed 15 Feb 2006 - 13:38:16 EST