[Rd] Can gzfile be given the same method option as file
Ivan Krylov
|kry|ov @end|ng |rom d|@root@org
Thu Sep 12 16:27:37 CEST 2024
В Thu, 12 Sep 2024 12:01:54 +0000
Simon Andrews via R-devel <r-devel using r-project.org> пишет:
> readRDS('https://seurat.nygenome.org/azimuth/references/homologs.rds')
> Error in gzfile(file, "rb") : cannot open the connection
I don't think that gzfile works with URLs. gzcon(), on the other hand,
does work with url() connections, which accepts the 'method' argument
and the getOption('url.method') default.
h <- readRDS(url(
'https://seurat.nygenome.org/azimuth/references/homologs.rds'
))
But that only works with gzip-compressed files. For example, CRAN's
PACKAGES.rds is xz-compressed, and I don't see a way to read it the
same way:
readBin(
index <- file.path(
contrib.url(getOption('repos')['CRAN']),
'PACKAGES.rds'
), raw(), 5
) |> rawToChar()
# [1] "\xfd7zXZ" <-- note the "7zXZ" header
readRDS(url(index))
# Error in readRDS(url(index)) : unknown input format
> 2. Given the warnings we're getting when using wininet, are their
> plans to make windows certficates be supported in another way?
What does libcurlVersion() return for you? In theory, it should be
possible to make libcurl use schannel and therefore the system
certificate store for TLS verification purposes.
--
Best regards,
Ivan
More information about the R-devel
mailing list