Displaying 20 results from an estimated 178 matches for "gzfile".
2002 Dec 05
1
writing to gzfile: segmentation fault (PR#2347)
...ich
Version: Version 1.6.0 (2002-10-01)
OS: Red Hat 7.1
Submission from: (NULL) (209.99.241.1)
The following sequence of commands crashes my R session. The first weirdness
happens after the second command that appears not to change the "foo.gz" file,
no error generated.
> con <- gzfile("foo.gz", open="w"); cat("goo\n", file=con); close(con)
con <- gzfile("foo.gz", open="w"); cat("goo\n", file=con); close(con)
> cat("boo\n", file=gzfile("foo.gz"))
# this doesn't change "foo.gz"
cat(...
2006 Oct 02
0
2.3.1: interacting bugs in load() and gzfile() (PR#9271)
Hello,
If repeated calls are made to save() using the same pre-opened gzfile
connection to a file, and then the connection is closed, the objects
saved by the second and subsequent calls are not correctly restored by
repeated calls to load() with a new gzfile connection to the same file.
What follows are a session exposing the bugs, analysis (see ANALYSIS),
patches (see PA...
2016 Nov 14
0
Read.dcf with no newline ending: gzfile drops last line
I don't know if this is a bug per se, but an undesired behavior in
read.dcf. read.dcf takes a file argument and passes it to gzfile if
it's a character:
if (is.character(file)) {
file <- gzfile(file)
on.exit(close(file))
}
This gzfile connection is passed to readLines (line #39):
lines <- readLines(file)
If no newline is at the end of the file, readLines doesn't give a
warning (I think app...
2008 Mar 07
2
Problems installing packages using the inbuilt facility: "Error i n gzfile(file, "r") : unable to open connection"
...utils:::menuInstallPkgs()
trying URL 'http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip <http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip> '
Content type 'application/zip' length 971893 bytes (949 Kb)
opened URL
downloaded 949 Kb
Warning in gzfile(file, "r") :
cannot open compressed file 'ada/DESCRIPTION', probable reason 'No such file or directory'
Error in gzfile(file, "r") : unable to open connection
> traceback()
6: gzfile(file, "r")
5: read.dcf(file.path(curPkg, "DESCRIPTION")...
2007 Jul 03
1
bug in closing gzfile-opened connections?
Hi,
I am making multiple calls to gzfile() via read.table(), e.g.
> x <- read.table( gzfile( "xxx.gz" ) )
After i do this many times (I haven't counted, but probably between 50 and
100 times) I get the error message:
Error in open.connection(file, "r") : unable to open connection
In addition: Warning messa...
2013 May 08
1
getting corrupted data when using readBin() after seek() on a gzfile connection
Hi,
I'm running into more issues when reading data from a gzfile connection.
If I read the data sequentially with successive calls to readBin(), the
data I get looks ok. But if I call seek() between the successive calls
to readBin(), I get corrupted data.
Here is a (hopefully) reproducible example. See my sessionInfo() at the
end (I'm not on Windows, where,...
2018 May 10
2
readLines() behaves differently for gzfile connection
When I read a .gz file with readLines() in 3.4.3, it returns text (and a
warning). In 3.5.0, it gives a warning, but no text. Is this expected
behavior or a bug?
3.4.3:
> source_file = "1k_annotation.gz"
> readfile_con <- gzfile(source_file, "r")
> readLines(readfile_con, n = 5)
[1] "#chr\tpos\tref\talt\t
<truncated output here>
Warning message:
In readLines(readfile_con, n = 5) :
seek on a gzfile connection returned an internal error
> close(readfile_con)
> sessionInfo()
R version 3.4.3...
2011 Oct 15
2
gctorture() and gzfile() doesn't get along.
Found the simpliest way of seeing I bug I encountered doing "R CMD check --use-gct": Just launch R (with --vanilla), and do this:
> ?gctorture
# this work
> gctorture()
> ?gctorture
Error in gzfile(file, "rb") :
can only weakly reference/finalize reference objects
# this does not
It seems that when gctorture() is on gzfile() doesn't work.
2004 Mar 15
1
gzfile & read.table on Win32
Hello ...
Are there any known problems or even gotchas to look out for when using a
gzfile connection in read.csv/read.table in Windows?
In the package PROcess, available at
www.bioconductor.org/repository/devel/package/html/PROcess.html
there are two files in the PROcess/inst/Test directory which are of the
extension *.csv.gz.
With both files, if I open up a gzfile connection, say:
vv...
2015 Nov 06
2
corrupt PACKAGES.gz?
Is it just me, or did a corrupt PACKAGES.gz file get installed in the
bin/windows/contrib/3.2 directory of CRAN mirrors recently? gzfile()
complains about it and Cygwin's gzip cannot decompress it. I tried the
following
repos <- "https://cran.rstudio.com"
v <- "3.2"
pkgs.gz <- paste(sep="/", repos, "bin/windows/contrib", v, "PACKAGES.gz")
tfile <- tempfile(fileext=...
2007 Dec 19
1
unexpected behavior from gzfile and unz
I get unexpected behavior from "readLines()" and
"scan()" depending on how the file is opened with
"gzfile" or "unz". More specifically:
> file <- gzfile("file.gz")
> readLines(file,1)
[1] "a\tb\tc"
> readLines(file,1)
[1] "a\tb\tc"
> close(file)
It seems that the stream is rewound between calls to
readLines. The same is true if I replace r...
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...
2008 Apr 20
1
How to read last (incomplete) line from gzfile()?
Hi,
I have some text files that do not have trailing \n on the last
(incomplete) line; how do I read in the last line?
e.g. here is a test case: [linux + R version 2.6.1 (2007-11-26) ]
z <- gzfile("short.gz", open="w")
cat("7\n5\n3", file=z)
close(z)
z <- gzfile('short.gz')
readLines(z)
[1] "7" "5"
readLines would indicate that for blocking connections (which I assume
this is), the last line (containing 3) would be read in, and...
2011 Oct 16
1
Error in gzfile(file, mode) when checking a package with rcmd check
...k/00install.out' for details.
In '00install.out', I get:
* installing *source* package 'pgirmess' ...
** R
** data
** preparing package for lazy loading
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded Error in gzfile(file,
mode) : cannot open the connection
Calls: %in% -> match -> installed.packages -> saveRDS -> gzfile
In addition: Warning message:
In gzfile(file, mode) :
cannot open compressed file
'U:\DOCUME~1\Admin\LOCALS~1\Temp\RtmpwWcmem/libloc_U%3a%2fDocuments%20and%20Settings%2fpgir...
2018 May 10
1
readLines() behaves differently for gzfile connection
...When I read a .gz file with readLines() in 3.4.3, it returns text (and a
> > warning). In 3.5.0, it gives a warning, but no text. Is this expected
> > behavior or a bug?
> >
> > 3.4.3:
> >> source_file = "1k_annotation.gz"
> >> readfile_con <- gzfile(source_file, "r")
> >> readLines(readfile_con, n = 5)
> > [1] "#chr\tpos\tref\talt\t
> >
> > <truncated output here>
> >
> > Warning message:
> > In readLines(readfile_con, n = 5) :
> > seek on a gzfile connection returned an...
2006 Nov 14
2
gzfile with multiple entries in the archive
If I open a tgz archive with gzfile and then parse it using readLines I miss
the initial line of each member of the archive - and also the name of the
file although the archive otherwise complete (but useless!).
Is there any way within R to extract both the list of files in a tgz archive
and to extract any one of these files?...
2018 May 10
0
readLines() behaves differently for gzfile connection
...r at gmail.com> wrote:
> When I read a .gz file with readLines() in 3.4.3, it returns text (and a
> warning). In 3.5.0, it gives a warning, but no text. Is this expected
> behavior or a bug?
>
> 3.4.3:
>> source_file = "1k_annotation.gz"
>> readfile_con <- gzfile(source_file, "r")
>> readLines(readfile_con, n = 5)
> [1] "#chr\tpos\tref\talt\t
>
> <truncated output here>
>
> Warning message:
> In readLines(readfile_con, n = 5) :
> seek on a gzfile connection returned an internal error
>
>> close(read...
2013 May 07
0
error when calling seek() twice on a gzfile connection
Hi,
I get an "internal error" when calling seek() twice on a gzfile
connection.
Create a gzip file:
bigraw <- sample(charToRaw("abcdef"), 30000000, replace=TRUE)
save(bigraw, file="bigraw.rda")
Open it:
con <- gzfile("bigraw.rda", "rb")
Then:
> seek(con, where=1)
[1] 0
> seek(con, where=24...
2009 Oct 27
2
Why I get this error? Error in close.connection(f) : invalid connection
I don't understand why I can not close 'f'. This may be very simple,
but I don't see why. Could somebody let me know?
$ cat gzfile.csv
"","V1","V2","V3","V4","V5"
"1",1,5,9,13,17
"2",2,6,10,14,18
"3",3,7,11,15,19
"4",4,8,12,16,20
$ Rscript gzfile.R
> f = file("gzfile.csv")
> A = read.csv(f)
> A
X V1 V2 V3 V4...
2005 Dec 09
1
local source packages install from within R session - cross-platform
...e it work in a X-platform way..i am often not
connected to the internet and have libraries that i would like to be able to
install in an automated way..
i've tried several things:
1)
install.packages("hs95av2hs3ug6cdf_6.0.0.tar.gz", repos=NULL,
method="source")
Error in gzfile(file, "r") : unable to open connection
In addition: Warning message:
cannot open compressed file 'hs95av2hs3ug6cdf_6.0.0.tar.gz/DESCRIPTION'
>traceback()
5: gzfile(file, "r")
4: read.dcf(file.path(curPkg, "DESCRIPTION"), c("Package", "Version...