Michael Lachanski
Michael Lachanski

Reputation: 67

R: Download Compressed File from Github ".tsv.gz" on a Mac

I have been unable to download a compressed ".tsv.gz" file from GitHub using R at the following URL on a Mac.

https://github.com/hadley/mastering-shiny/blob/main/neiss/injuries.tsv.gz

This should be a routine command, but download.file() and nothing at the following URL worked.

Downloading and unzipping GitHub zipped files directly in R

Upvotes: 0

Views: 240

Answers (1)

Michael Lachanski
Michael Lachanski

Reputation: 67

Simply changing the URL to:

https://raw.githubusercontent.com/hadley/mastering-shiny/main/neiss/injuries.tsv.gz

was sufficient. Weirdly, adding "?raw=TRUE" to the URL, https://github.com/hadley/mastering-shiny/blob/main/neiss/injuries.tsv.gz, which also leads to the "raw" version of the file, does not work so more color on this would be appreciated.

Upvotes: 0

Related Questions