Closed jameshunterbr closed 3 years ago
Hi there:
Sorry but I cannot reproduce that. Could you please verify that it is was not caused by a temporary network glitch and if you continue to encounter that issue post the complete error message together with the output of devtools::session_info()
?
Thanks!
I've tried it again with both remotes and devtools. Here is the output and the sessionInfo.
remotes::install_github("joachim-gassen/tidycovid19") Downloading GitHub repo joachim-gassen/tidycovid19@HEAD Error in utils::download.file(url, path, method = method, quiet = quiet, : download from 'https://api.github.com/repos/joachim-gassen/tidycovid19/tarball/HEAD' failed devtools::install_github("joachim-gassen/tidycovid19") Downloading GitHub repo joachim-gassen/tidycovid19@HEAD Error in utils::download.file(url, path, method = method, quiet = quiet, : download from 'https://api.github.com/repos/joachim-gassen/tidycovid19/tarball/HEAD' failed
devtools::session_info()
- Session info --------------------------------------------------------------------------------------------------------- setting value
version R version 4.0.3 (2020-10-10) os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz America/Sao_Paulo
date 2020-11-25
[1] C:/Users/james/OneDrive/Documents/R/win-library/4.0 [2] C:/Program Files/R/R-4.0.3/library
Thank you! While I still cannot reproduce this issue, I have two suggestions.
Can you check whether the following works for you:
options()$download.file.method
tfile <- tempfile()
file <- utils::download.file('https://api.github.com/repos/joachim-gassen/tidycovid19/tarball/HEAD', tfile)
Based on the above, it should not. I wonder whether this might be related to your file download method (this is why I included the options call above). You could play around with the method options that are available for your OS. See here for people having similar issues: https://github.com/r-lib/remotes/issues/130.
The obvious question: Do you face similar problems with other Github repos? If not and the above is inconclusive then I can only speculate that the relative large file size (41.7 MB) plays a role.
Last question first: no, this is the first time I have encountered this with a GitHub repo package. I have downloaded many before.
This is the output I get from your test code:
> options()$download.file.method
NULL
> tfile <- tempfile()
> file <- utils::download.file('https://api.github.com/repos/joachim-gassen/tidycovid19/tarball/HEAD', tfile)
trying URL 'https://api.github.com/repos/joachim-gassen/tidycovid19/tarball/HEAD'
Content type 'application/x-gzip' length unknown
downloaded 41.8 MB
> tfile
[1] "C:\\Users\\james\\AppData\\Local\\Temp\\RtmpisYPWN\\file110436b01ac8"
>
There is a file in the directory indicated in tfile that is 41.7 MB.
So, something happened. What, I'm not sure.
So the download works. What confuses me is that your method for downloading files is set to NULL. Normally, on windows, it defaults to:
> options()$download.file.method
[1] "wininet"
However, the install_github code sets the download method to "auto" if the option is set to NULL and this also works in my Windows environment. The last hint that I can give you is to explicitly change the method to "wininet" prior to calling install_github to see whether this helps.
options(download.file.method = "wininet")
remotes::install_github("joachim-gassen/tidycovid19")
Good luck and thanks for letting me (and potential others) know whether it works.
That was it, Joachim. changing the options to "wininet" made the download successful. Many thanks for the help.
Cannot seem to download the package as remotes::install_github("joachim-gassen/tidycovid19") does not find the tarball