Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用read_delim从URL读取压缩文件_R - Fatal编程技术网

使用read_delim从URL读取压缩文件

使用read_delim从URL读取压缩文件,r,R,除了使用连接,还有其他方法可以使用readr包中的read_delim函数从URL读取.gz文件吗?e、 g: temp <- tempfile() download.file("http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeHaibMethylRrbs/wgEncodeHaibMethylRrbsImr90UwSitesRep1.bed.gz",destfile=temp,method="curl") d

除了使用连接,还有其他方法可以使用readr包中的read_delim函数从URL读取.gz文件吗?e、 g:

temp <- tempfile()
download.file("http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeHaibMethylRrbs/wgEncodeHaibMethylRrbsImr90UwSitesRep1.bed.gz",destfile=temp,method="curl")
d <- read_delim(gzfile(temp), delim='\t', skip=1)

temp文档中说它可以是文件、连接或“原始数据”(以字符串形式)。我想我的问题是我想在URL中的这个压缩文件上使用read_delim,但我得到一个错误:“collectorsGuess中的错误(源代码,标记器,n=100):字符串中嵌入nul:'\x89\0”。文档中说,read_delim在使用
download.file(“http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeHaibMethylRrbs/wgEncodeHaibMethylRrbsImr90UwSitesRep1.bed.gz",destfile=“wgencodehaibmethyrrbsimr90uwsitesrep1.bed.gz”)
d但它仍然不能直接从URL读取压缩文件。我在reader github网站上写了这个问题。我一直认为,如果一个文件被压缩,您需要以某种方式提取它以便读取它,无论是服务器端还是本地端。哦,好吧。。。