使用read_delim从URL读取压缩文件
除了使用连接,还有其他方法可以使用readr包中的read_delim函数从URL读取.gz文件吗?e、 g:使用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
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网站上写了这个问题。我一直认为,如果一个文件被压缩,您需要以某种方式提取它以便读取它,无论是服务器端还是本地端。哦,好吧。。。