I was following along this SO post on how to download and unzip a file.
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)
Everything runs fine in the above block except the last line which returns
> 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
How can I unzip GoogleNews-vectors-negative300.bin.gz after downloading it?