question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support `install.R` files

See original GitHub issue

We should support R functionality. R handles dependencies differently from both Python and Julia, here are some thoughts from Carl:

Current proposal

  • Use runtime.txt to specify the R version as a date.
    • We’ll expect a line with the format r-YYYY-MM-DD. E.g. 2017-01-21.
    • If that line is found, it will trigger and R build in r2d. This sets up a version of R that was current at that date, and sets the MRAN snapshot for that date as the default repo.
    • We’ll also set up an R kernel for jupyter to discover. This R will also make sure we are installing in a user-owned library path so stuff can be installed there at any point.
  • Use install.R (must be executable) to execute with the installed R kernel (in the point above). This primarily lets people write R code that installs packages.
  • If install.R is given without a r-YYYY-MM-DD line in runtime.txt then we raise an error.

Main to-do items

  • How do users specify what servers contain what packages (e.g. rstudio vs. bioconductor)
  • ~What about non-CRAN packages?~ outside of the standard R repositories, we can’t do much else other then tell people to clone a github repo of preference and install it with install.R or postBuild or something.
  • How can we ensure versions are frozen, since R doesn’t easily handle specific version installs?
  • Someone needs to actually implement this!

Notes

In an R package, the DESCRIPTION file plays the role of a requirements.txt in stating the dependencies, minimal version needed, and where get them (e.g. CRAN or additional cran-type repo like bioconductor).

This approach does not accommodate installing something that is not the most recent version of a package. (CRAN archives old sources, but because, unlike python or ruby gems distribution, CRAN is designed to provide binaries & you can’t guarantee binaries build for an old /archived source, the default install does not immediately support installing archived packages).

If you just have a list of packages you want, I recommend something along the lines of what we do with rocker, e.g.

install2.r cat deps.txt

Where deps.txt is just a list of package names you want to install. If these come from multiple repos (cran & bioconductor), just list those as arguments to -r:

install2.r -r “https://cran.rstudio.com” -r “https://bioconductor.org/pagkages/releasecat deps.txt

If you want to install the same version each time, just use an MRAN snapshot of the appropriate date.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
yuvipandacommented, Oct 18, 2017

Me and @cboettig just talked about this!

  1. Specify the R version as a date in runtime.txt. So a value like r-2017-01-21 needs to be set there to ‘trigger’ R. This sets up a version of R that was current at that date, and sets the MRAN snapshot for that date as the default repo. We’ll also set up R kernel for jupyter to discover. This R will also make sure we are installing in a user-owned library path so stuff can be installed there at any point.
  2. If there’s an install.r executable script, that is then executed with the installed R. This lets people write R code that installs packages. This seems to be the most common & accepted way to install libraries.

We can deal with packrat later. This current solution seems like a good start to supporting the R community on binder/repo2docker.

1reaction
choldgrafcommented, Dec 13, 2017

I think that we should pivot this issue to be specifically about adding an R build pack (e.g. supporting install.R or something like this). Will change title to reflect this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

R Installation and Administration
The simplest way is to download the most recent R- x . y . z .tar.gz file, ... If the Linux distribution supports...
Read more >
A Installing R and RStudio | Hands-On Programming with R
To install R on Windows, click the “Download R for Windows” link. Then click the “base” link. Next, click the first link at...
Read more >
How to Install R, RStudio and R Packages - DataFlair
With this tutorial, we will learn to install RStudio and R for Mac, Linux, and Windows along with its process of updating in...
Read more >
General problem installing any R package - Microsoft Support
When trying to install any R package on your system, for example: ... file permissions to be able to write to the current...
Read more >
How to Install a Package in R (example included) - Data to Fish
Step 1: Launch R · Step 2: Type the command to install the package · Step 3: Select a Mirror for the installation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found