Re: [Rd] Decompressing raw vectors in memory

2012-05-02 Thread Hadley Wickham
> I understand the desire not to have any dependency on additional > packages, and I have no desire to engage in any "mine's better" exchanges. > So write this just for the record. > The gzunzip() function handle this. Funnily enough I just discovered that RCurl already handles this: you just need

Re: [Rd] Decompressing raw vectors in memory

2012-05-02 Thread Duncan Temple Lang
I understand the desire not to have any dependency on additional packages, and I have no desire to engage in any "mine's better" exchanges. So write this just for the record. The gzunzip() function handle this. > library(RCurl); library(Rcompression) > val = getURLContent("http://httpbin.org/gzip

Re: [Rd] Decompressing raw vectors in memory

2012-05-02 Thread Hadley Wickham
> Well, it seems what you get there depends on the client, but I did > > tystie% curl -o foo "http://httpbin.org/gzip"; > tystie% file foo > foo: gzip compressed data, last modified: Wed May  2 17:06:24 2012, max > compression > > and the final part worried me: I do not know if memDecompress() know

Re: [Rd] Decompressing raw vectors in memory

2012-05-02 Thread Prof Brian Ripley
On 02/05/2012 16:43, Hadley Wickham wrote: I'm struggling to decompress a gzip'd raw vector in memory: content<- readBin("http://httpbin.org/gzip";, "raw", 1000) memDecompress(content, type = "gzip") # Error in memDecompress(content, type = "gzip") : # internal error -3 in memDecompress(2) I'

Re: [Rd] Decompressing raw vectors in memory

2012-05-02 Thread Hadley Wickham
>> I'm struggling to decompress a gzip'd raw vector in memory: >> >> content<- readBin("http://httpbin.org/gzip";, "raw", 1000) >> >> memDecompress(content, type = "gzip") >> # Error in memDecompress(content, type = "gzip") : >> #  internal error -3 in memDecompress(2) >> >> I'm reasonably certain

Re: [Rd] Decompressing raw vectors in memory

2012-05-02 Thread Prof Brian Ripley
On 02/05/2012 14:24, Hadley Wickham wrote: Hi all, I'm struggling to decompress a gzip'd raw vector in memory: content<- readBin("http://httpbin.org/gzip";, "raw", 1000) memDecompress(content, type = "gzip") # Error in memDecompress(content, type = "gzip") : # internal error -3 in memDecompre

[Rd] Decompressing raw vectors in memory

2012-05-02 Thread Hadley Wickham
Hi all, I'm struggling to decompress a gzip'd raw vector in memory: content <- readBin("http://httpbin.org/gzip";, "raw", 1000) memDecompress(content, type = "gzip") # Error in memDecompress(content, type = "gzip") : # internal error -3 in memDecompress(2) I'm reasonably certain that the file