Setting up an R environment

I almost never use R, but I occasionally want to play with something in a REPL or write a quick script. Since I don’t use it often, I don’t want it to clutter up my system packages or home folder, so installing via APT or manually is out. That leaves these options:

When I worked in bioinformatics we used Conda environments quite a bit. But that whole ecosystem was very much in flux last time I checked. And since I don’t care about reproducibility for this use case, the overhead of managing conda envs isn’t worth it. Also, Conda can’t be installed via APT in Debian, and managing a manual installation kinda defeats the purpose.

So, Podman it is.

… or so I thought.

Actually, the container images used by the R-Hub CI project are basically all based on Debian, so I might as well just install from APT. This seems to be the most stable and well-tested distribution of R.

Also, it turns out that most of the basic system can be installed with just apt install --no-install-recommends r-base-core, which only installed a single 44 MB package on my system, so it doesn’t actually cause that much clutter. I also added r-doc-html to get the high-level manuals. The API documentation is available from the REPL without needing to install anything else.