Re: [R] read.table

From: Kjetil Brinchmann Halvorsen <kjetilbrinchmannhalvorsen_at_gmail.com>
Date: Wed 15 Feb 2006 - 00:00:18 EST

Diethelm Wuertz wrote:
> Thanks a lot that works fine!
>
> Next problem, if I would have my own package, and the file "test.csv"
> would be located in the data directory
>
> How to use the function data to get
>
> > data(test)

Also put in the data subdirectory the file test.R with the commands to read test.csv

Kjetil

>
> resulting in:
>
> > test
>
> %y-%m-%d VALUE
> 1 1999-01-01 100
> 2 2000-12-31 999
>
>
> Again Thanks in advance Diethelm Wuertz
>
>
>
>
> Phil Spector wrote:
>

>> Look at the check.names= argument to read.table -- you want to set it
>> to FALSE.  But rememeber that you'l have to put quotes around the name
>> whenever you use it, as in x$'%y-%m-%d'
>>
>>                                        - Phil Spector
>>                      Statistical Computing Facility
>>                      Department of Statistics
>>                      UC Berkeley
>>                      spector@stat.berkeley.edu
>>
>> On Tue, 14 Feb 2006, Diethelm Wuertz 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
>

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 Wed Feb 15 00:05:21 2006

This archive was generated by hypermail 2.1.8 : Wed 15 Feb 2006 - 14:34:55 EST