search for: gzcon

Displaying 20 results from an estimated 41 matches for "gzcon".

2020 Jun 29
0
A warning in gzcon but not in gzfile
Hi all, I used `gzfile` and `gzcon` to read a compressed file but I found that `gzcon` gave me a different result than `gzfile`. It seems like the `gzcon` does not handle the data correctly. I have posted an example below. In the example, a portion of a compressed file is downloaded from Google Cloud as a raw vector, and the data is...
2015 Mar 03
0
Feature request: copy attributes in gzcon
The `gzcon` function both modifies and copies a connection object: # compressed text con1 <- url("http://www.stats.ox.ac.uk/pub/datasets/csb/ch12.dat.gz") con2 <- gzcon(con1) # almost indistinguishable con1==con2 identical(summary(con2), summary(con1)) # both support gzip re...
2011 Mar 11
0
is gzcon w/ urls not implemented or used differently on linux?
I wrote some code which reads a gzipped text file directly from the web with gzcon(url()) and it works perfectly on OSX, but I cannot get it to work on linux at all, trying several different R versions and linux distributions. Any ideas? Here's an example of my code: z <- gzcon(url("ftp://ftp-private.ncbi.nlm.nih.gov/pubchem/.fetch/8897497837079742771.sdf.gz"))...
2006 Oct 02
0
2.3.1: interacting bugs in load() and gzfile() (PR#9271)
...two objects, one at a time > f <- gzfile("tmp.dat", "rb") > e <- new.env() > load(f,e) > ls(e) [1] "x" ## x was loaded correctly, but the connection has been closed: > f description class mode text "gzcon(tmp.dat)" "gzcon" "rb" "binary" opened can read can write "closed" "yes" "no" ## <interaction> (see ANALYSIS) ## Try again: > load(f,e)...
2018 May 01
1
possible internal (un)tar bug
...onnection, but works > fine on a plain file name. Well, there's an easy workaround: If you want to use a connection (instead of a simple filename) with untar() and want to use compression (as in the example), you can currently do that easily when you ensure the connection is a "gzcon" one : ##=========> Workaround for now: ## Create : setwd(tempdir()) ; dir.create("pkg") cat("this: that\n", file = file.path("pkg", "DESCRIPTION")) tf <- "pkg_1.0.tar.gz" tar(tf, "pkg", compression = "gzip", tar =...
2011 Jan 21
1
Reading gz compressed csv file - 'incomplete line found'
...file. My code: myurl <- "ftp://ftp.ncbi.nih.gov/pub/geo/DATA/supplementary/series/GSE24729/GSE24729_MitoNuclear_suppl_male_stats.csv.gz" # myfile <- "GSE24729_MitoNuclear_suppl_male_stats.csv.gz" # download.file(myurl, destfile=myfile, mode="w") # mycon <- gzcon(gzfile(myfile, open="r")) # mydata <- read.csv(textConnection(readLines(mycon))) # close(mycon) works under my linux distribution, but under windows, I get the following warning: > myurl <- "ftp://ftp.ncbi.nih.gov/pub/geo/DATA/supplementary/series/GSE24729/GSE24729_Mito...
2017 Aug 09
1
Problem with serialization via readRDS() on a textConnection()
...message.) Your code > zz = textConnection('tempConnection', 'wb') > saveRDS(c("a", "b", "c"), zz, ascii = TRUE) > serialized_obj = paste(textConnectionValue(zz), collapse='\n') > readRDS(textConnection(serialized_obj)) Error in gzcon(file) : 'read' not enabled for this connection has one problem: textConnectionValue(zz) may not be the complete text because zz hasn't been closed. You should close(zz), then get the result from the variable tempConnection. However, this doesn't fix the problem you saw, which...
2020 Jan 22
1
Memory error in the libcurl connection code
...n the libcurl connection code that typically happens when libcurl reads big chunks of data. This potentially affects all code that use url() with the libcurl download method, which is the default in most builds. In practice it tends to happen more with HTTP/2 and if the connection is wrapped into a gzcon(). macOS Catalina has a libcurl build with HTTP/2 error, so many users that upgraded macOS are starting to see this. The workaround is to avoid using url(), if you can. If you need an HTTP stream, you can use curl::curl(), which is a drop-in replacement. To reproduce, the easiest is a libcurl bui...
2018 May 01
2
possible internal (un)tar bug
This is a not too old R-devel on Linux, it already fails in R 3.4.4, and on macOS as well. The tar file seems valid, external tar can untar it, so maybe an untar() bug. setwd(tempdir()) dir.create("pkg") cat("foobar\n", file = file.path("pkg", "NAMESPACE")) cat("this: that\n", file = file.path("pkg", "DESCRIPTION"))
2010 Sep 08
2
Uncompressing data from read.socket
Hi, Is it possible to uncompress gzipped data coming over a socket? [[alternative HTML version deleted]]
2008 Feb 28
2
compress data on read, decompress on write
Dear All, I'd like to be able to have R store (in a list component) a compressed data set, and then write it out uncompressed. gzcon and gzfile work in exactly the opposite direction. What would be a good way to handle this? Details: ---------- We have a package that uses C; part of the C output is a large sparse matrix. This is never manipulated directly by R, but always by the C code. However, we need to store that data some...
2017 Aug 23
1
How to benchmark speed of load/readRDS correctly
Hi there Thanks for your answers. I didn't expect that this would be so complex. Honestly, I don't understand everything you wrote since I'm not an IT specialist. But I read something that reading *.rds files is faster than loading *.Rdata and I wanted to proof that for my system and R version. But thanks anyway for your time. Cheers Raphael > -----Urspr?ngliche Nachricht-----
2005 Jan 05
0
zlib
...ta) I implemented it in Python using the zlib module and the decompress method. The Python code is: data = file.read(compresslength) #read x number of bytes result = struct.unpack("3d", zlib.decompress(data)) #decompress data and convert bytes to 3 doubles I also tried: data = readBin(gzcon(infile), integer(), compresslength, 1) But it returns what I asked for....a vector of 1 bytes with a length equal to compresslength. It seems that the arguments to readBin require prespecification of the result, which I can't really provide. gzfile and gzcon wrap a connection, but then in o...
2009 Jan 19
1
gz netCDF files
Hello, I am trying to access several netCDF files that are also zipped (via gzip I guess) (and stored in a directory that I only have reading permit) I tried to unzip them using gzfile, gzcon, etc, and then open them with open.ncdf (from ncdf package). Everything was unsuccesful. I had no problem using the ncdf package with "normal" netCDF files I would really appreciate any suggestion Thanks Magdalena Lucini Dept. of Physics U of Toronto
2009 Jul 17
1
Problem With Repeated Use Of Load/Save/Close Commands
Hello, I'm having a problem in R with repeated use of the "load", "save", and "close" commands. I'm getting an error message that reads, "Too many open files". I'm opening files and closing them (and unlinking them), but when I go through that process 509 times, the program halts and I get this error message: "cannot open the
2008 Oct 09
1
Reading zipped data directly from an FTP url
...g message: In open.connection(file, "r") : cannot open compressed file 'ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.gallus_gallus .zip', probable reason 'No such file or directory' With all the different ways of opening connections (url(), unz(), gzfile(), gzcon() etc) I am just getting a bit lost. The above zip archive contains a single tab-delimited file, but one which I need to skip the first 5 lines. Any help appreciated! Thanks Mick
2017 Feb 27
5
Test suite failures in R-devel_2017-02-25_r72256
...'Couldn't resolve host name' | Error in url(sprintf("%s/%s", cran, path), open = "rb") : | cannot open the connection to 'http://CRAN.R-project.org/web/packages/packages.rds' | Calls: CRAN_package_db -> as.data.frame -> read_CRAN_object -> gzcon -> url | Execution halted I'm wondering whether it would be possible to extend the test suite with a configure-time flag that disable tests which depend on network access? My experience is that most modern Linux distributions run their builds in a restricted environment and t...
2007 Oct 30
1
postscript(), used from a pre R-2.6.0 workspace
...e="z.ps"), I get:: > ls() character(0) > load(url("http://www.maths.anu.edu.au/~johnm/r/test5.RData")) > postscript(file="z.ps") Error in postscript(file = "z.ps") : Invalid font type In addition: Warning messages: 1: closing unused connection 3 (gzcon(http://www.maths.anu.edu.au/~johnm/r/test5.RData) ) 2: In postscript(file = "z.ps") : font family not found in PostScript font database 3: In postscript(file = "z.ps") : font family not found in PostScript font database Or R may be started in a workspace with such a .RDa...
2020 Feb 29
3
R 3.6.3 is released
...of the NEWS file CHANGES IN R 3.6.3: NEW FEATURES: * The included LAPACK has been updated to version 3.9.0 (for the included routines, just bug fixes). BUG FIXES: * Fixed a C level integer overflow in rhyper(); reported by Benjamin Tyner in PR#17694. * Uses of url(gzcon(.)) needing to extend buffer size have failed (with HTTP/2 servers), reported by G'abor Cs'ardi. * predict(loess(..), se=TRUE) now errors out (instead of seg.faulting etc) for large sample sizes, thanks to a report and patch by Benjamin Tyner in PR#17121. * tools...
2020 Feb 29
3
R 3.6.3 is released
...of the NEWS file CHANGES IN R 3.6.3: NEW FEATURES: * The included LAPACK has been updated to version 3.9.0 (for the included routines, just bug fixes). BUG FIXES: * Fixed a C level integer overflow in rhyper(); reported by Benjamin Tyner in PR#17694. * Uses of url(gzcon(.)) needing to extend buffer size have failed (with HTTP/2 servers), reported by G'abor Cs'ardi. * predict(loess(..), se=TRUE) now errors out (instead of seg.faulting etc) for large sample sizes, thanks to a report and patch by Benjamin Tyner in PR#17121. * tools...