Re: [R] Problems with source() function

From: Al <>
Date: Sat 29 Oct 2005 - 02:07:17 EST

I'm trying to feed data generated on-the-fly by a PHP script using R function source(), passing the arguments in the URL, using GET method (""). If not on-the-fly, the user has to wait more and get the data in more than one step.

I'm trying a one-step simple method but for some reason the source() function truncates silently the data. I will try your suggestion of a binary file if I can generate the gzip stream on-the-fly...

Thank you!


Alberto de Luis
Bioinformatics and Functional Genomics Lab Cancer Research Center
Salamanca (Spain)

On Fri, 2005-10-28 at 06:57 -0700, Seth Falcon wrote:
> On 28 Oct 2005, wrote:
> > Thank you for your answer :)
> >
> > I've tested your suggestion but without success. The remote load
> > process is truncated silently using
> >
> > source(textConnection(readLines(url(http://...)))
> >
> > when look at the contents there's not a fixed point of break, is
> > different each time I execute the command. Therefore the dropped
> > lines are different every time. It seems the only constant is the
> > time of the interruption (1 min 55 secs in my system).
> I'm not sure exactly what you are trying to accomplish, but I wonder
> if either of the following two ideas would help you:
> 1. Instead of source(), consider loading the R code on the server side
> and then using save(..., compres=TRUE) to create a binary image.
> You can then feed that to the clients and have them use load().
> 2. What happens if you gzip the code before sending and gunzip on the
> client side. It may be less convenient, although supposedly there
> is a way to do the equivalent of gzfile(url(...)).
> HTH,
> + seth
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Sat Oct 29 02:13:45 2005

This archive was generated by hypermail 2.1.8 : Sat 29 Oct 2005 - 03:44:45 EST