change read.table by scan

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

change read.table by scan

herodote@oreka.com
Hi all,

Before the amount of data given has grown i was initially using read.table to load the values inside R.

It was feeding my needs because i could tell read.table h=T, then use attach to access the values by columns names.

Now it takes 20 seconds to load the data's and the first enhancement i could do is to win some time on the load of the data's...

How could i use the scan function (which is faster) to build the data as if i've used read.table("file",h=T) then attach?

/* the code i use actually */
tab<-read.table("blob/data.dat",h=T)
attach(tab)
/* is it possible to produce the same using scan? */


thks all for understanding my question.

guillaume.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: change read.table by scan

Brian Ripley
read.table _does_ use scan, so why do you claim scan is faster?

There is so much you have not told us that it is impossible to know what
you want.  Please do read the posting guide and its references and try to
ask a question that is not predicated on a falsehood.

On Mon, 19 Dec 2005, [hidden email] wrote:

> Hi all,
>
> Before the amount of data given has grown i was initially using
> read.table to load the values inside R.
>
> It was feeding my needs because i could tell read.table h=T, then use
> attach to access the values by columns names.
>
> Now it takes 20 seconds to load the data's and the first enhancement i
> could do is to win some time on the load of the data's...
>
> How could i use the scan function (which is faster) to build the data as
> if i've used read.table("file",h=T) then attach?
>
> /* the code i use actually */
> tab<-read.table("blob/data.dat",h=T)
> attach(tab)
> /* is it possible to produce the same using scan? */
>
>
> thks all for understanding my question.
>
> guillaume.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
Brian D. Ripley,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html