我一直在this上关注如何下载和解压缩文件。
url <- 'https://s3.amazonaws.com/dl4j-distribution/GoogleNews-vectors-negative300.bin.gz'
file <- basename(url)
download.file(url, file)
tmpdir <- tempdir()
untar(file, compressed = 'gzip', exdir = tmpdir)
除了最后一行返回
之外,上述代码中的所有内容都运行正常> untar(file, compressed = 'gzip', exdir = tmpdir)
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
Warning message:
In untar(file, compressed = "gzip", exdir = tmpdir) :
‘/usr/bin/tar -xf 'GoogleNews-vectors-negative300.bin.gz' -C '/var/folders/ll/g08vjcnd33vdhf250bbg9230fdw13f/T//RtmpAICV5a'’ returned error code 1
下载后如何解压缩GoogleNews-vectors-negative300.bin.gz?