I am currently running R on mac osx but am looking to purchase a linux server for more power. Is there any way that I can check for specific R packages whether they will also work on linux? (before, of course, I actually buy the server and try to install and run the given packages). Also, is there any way to determine if a given package would run on certain linux distributions but not others (e.g. Ubuntu vs. Debian)?
-
1https://cran.r-project.org/bin/linux/debian/ and https://cran.r-project.org/bin/linux/ubuntu/ – Rich Scriven Apr 08 '17 at 16:55
-
@RichScriven great, thanks for the link. On it, they mention "A number of R packages are available from the Ubuntu repositories" and then list some packages. Afterwards, it says, "The other r-cran-* packages are updated with Ubuntu releases only. Users who need to update one of these R packages (say r-cran-foo) should ...". So, does this imply that basically any R package should be available on most any linux distribution, and it's just a question of how frequently it's updated and where precisely you get it? – Michael Ohlrogge Apr 08 '17 at 17:07
2 Answers
Assuming the package is on CRAN, go to the package's CRAN page, e.g. https://cran.r-project.org/package=zoo and then click on the link to the right of CRAN checks
which in this example would be labelled zoo results
. It would take you to this page: https://cran.r-project.org/web/checks/check_results_zoo.html showing the results of checking that package on various different platforms.
If the package is not on CRAN but is on github and the developer checks it with Travis-CI then you can view the check by clicking on the Travis-CI icon. For example, the klmr modules package is not on CRAN (there is a CRAN package of the same name but it's different); however, if you look at its github home page at https://github.com/klmr/modules and click on the icon which currently is black and green and reads build passing
(but could read something else if there are changes to the package or R that breaks tests) then you will be taken to the Travis-CI tests at https://travis-ci.org/klmr/modules .

- 254,981
- 17
- 203
- 341
-
Great, this is very helpful. So, to help me understand the results of those checks, if the check for `r-release-linux-x86_64` is OK, that's the main thing that I would want to look for, right, and if that is the case, then the package would work on any linux distribution? The distribution specific checks on that link seem to be just for development versions of R. – Michael Ohlrogge Apr 08 '17 at 18:25
-
1It's best if it reads OK but even if it reads WARN it likely just fails some rigid rule without really breaking the fact that it works. If it fails on the devel version but not on the current version then it's likely a problem introduced by the new R verson or an addition of a check in that version of R that was not there before. For example, the devel versions of R have a WARN for zoo which is likely due to an additional test in the devel version of R but zoo still works fine despite this. – G. Grothendieck Apr 08 '17 at 18:28
tl;dr Slightly opinion/personal experience based, but I would be surprised if there were any CRAN package that you couldn't get running on Linux.
In general Unix users tend to install packages from source: CRAN doesn't provide binaries, but source installation is usually painless. The package binaries that are available (the CRAN Linux page has links for Debian, Ubuntu, SUSE, and Red Hat) tend to focus on packages that have extra system-level dependencies (e.g. FFT libraries, or spatial data analysis libraries) where it's more of a nuisance to assemble the needed dependencies for a particular system.
From the CRAN repository policy:
Package authors should make all reasonable efforts to provide cross-platform portable code. Packages will not normally be accepted that do not run on at least two of the major R platforms [i.e. Windows, MacOS, Linux]. Cases for Windows-only packages will be considered, but CRAN may not be the most appropriate place to host them.
When a package fails to run on of one of the three platforms, it's usually Windows. The only package I've ever had real trouble installing on Linux is R2OpenBUGS on 64-bit systems, because it requires installing a 32-bit toolchain.

- 211,554
- 25
- 370
- 453
-
Great, that is helpful to know about why some packages have the special listing on the CRAN linux page, since that was not very clear to me before! – Michael Ohlrogge Apr 08 '17 at 17:59
-
I also had a quick followup question to one of your comments, which I posted here as a separate query: http://stackoverflow.com/questions/43298666/r-install-package-from-source-vs-use-install-package-and-cran-mirror – Michael Ohlrogge Apr 08 '17 at 18:13
-
Re accepting my answer: I actually think @G.Grothendieck's answer is better (more concrete) than mine, but perhaps this is the general context you were looking for ... – Ben Bolker Apr 08 '17 at 18:14
-
Got it, I was very much on the fence between which answer to accept. I'll trust your judgment of @G.Grothendieck's answer being better and switch to that, but I found your general assurance to be very useful! – Michael Ohlrogge Apr 08 '17 at 18:18