I would like to extract a JSON file compressed with Lzip (.lz). I have tried with untar, unzip, and the archive library, sadly none of them work.
download.file(url = "https://parltrack.org/dumps/ep_votes.json.lz",
destfile = "ep_votes.json.lz",
mode = "wb")
archive("ep_votes.json.lz")
# Erreur : archive.cpp:37 archive_read_open1(): Unrecognized archive format
untar("ep_votes.json.lz", exdir = ".")
# tar.exe: Error opening archive: Can't initialize filter; unable to run program "lzip -d -q"
# Warning message:
# In untar("ep_votes.json.lz", exdir = ".") :
# ‘tar.exe -xf "ep_votes.json.lz" -C "."’ returned error code 1
unzip("ep_votes.json.lz", exdir = ".")
# Warning message:
# In unzip("ep_votes.json.lz", exdir = ".") :
# erreur 1 lors de l'extraction d'un fichier zip
Here is the documentation about lzip: https://www.nongnu.org/lzip/lzip.html.
It works naturally with Winrar but I would like to do it in R directly.
Do you have an idea on how to fix those errors or is there another solution?