r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
330 stars 152 forks source link

Unable to install a package form a Github subdir #725

Open lnalborczyk opened 1 year ago

lnalborczyk commented 1 year ago

Hi,

I have a package hosted in a sub-directory of a Github repo: https://github.com/lnalborczyk/IMSB2022/tree/master/_imsb. Note that the name of the package is prefixed with "_" because it is part of a quarto website and I do not want it to be rendered by quarto (maybe that is what is causing the issue below?).

When I try to install the package with remotes::install_github(repo = "lnalborczyk/IMSB2022/_imsb") or remotes::install_github(repo = "lnalborczyk/IMSB2022", subdir = "/_imsb"), I get the following error message:

Downloading GitHub repo lnalborczyk/IMSB2022@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  download from 'https://api.github.com/repos/lnalborczyk/IMSB2022/tarball/HEAD' failed

It seems the subdir argument is ignored... Any idea why?

NB: specifying the full URL with remotes::install_github(repo = "lnalborczyk/IMSB2022", subdir = "/tree/master/_imsb") results in a 404 error...

Thank you for your help!

Ladislas

gaborcsardi commented 1 year ago
remotes::install_github("lnalborczyk/IMSB2022/_imsb")

works for me, so please try the latest remotes version, the dev version, and if it please fails, add more details about your system.

lnalborczyk commented 1 year ago

Thank you for your prompt answer!

It works now for me too, when increasing the timeout with options(timeout = 240) before trying to install the package from Github, so it may have been a connection issue...

Thank you again for your help!

Ladislas