1

never used R before. I need to integrate R into continuous build.

The script I got has the line

RUN Rscript -e "devtools::install_github('my-repo', auth_token = '"$Github_Token"')"

I know this command will download the entire repo, but how is the package installed? Is it looking for the .R files, or is it looking for the .rba files?

My goal is to integrate a build process with a CI. I found a way to construct these rba files through a docker container, but these will not be checked into github. I need to make sure the install doesn't require these rba files, then I can move these files somewhere else.

JChao
  • 2,178
  • 5
  • 35
  • 65
  • 1
    Take a look at [general instructions for R package installation](https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installing-packages). You can think of `install_github` as a wrapper around this base functionality. – Artem Sokolov Nov 06 '18 at 16:54
  • 1
    It downloads the source, builds it and installs it using `install.packages` mechanism for source packages (see [here](https://github.com/r-lib/remotes/blob/cc971aa7452c0e748d3d2a916c839f15372049bc/install-github.R#L3407), [here](https://www.rdocumentation.org/packages/utils/versions/3.5.1/topics/install.packages) and [here](https://stackoverflow.com/questions/1474081/how-do-i-install-an-r-package-from-source)). – Roman Luštrik Nov 06 '18 at 17:05

1 Answers1

2

The function install_github installs a package the same as any other method of package installation, but automates the download from github for you. The remote repository needs to be an R package, meaning it needs to have at least an R/ directory containing R code, a DESCRIPTION file containing the package metadata, and a NAMESPACE file describing the package imports and exports.

For install_github to work, it should not inherently require that your rba files are present.

For more information on packages, I suggest reading R packages.

C. Braun
  • 5,061
  • 19
  • 47