Re: Have M-x R point at the most recent version of R
Dominic Steinitz via ESS-help <[email protected]> Wed, 4 Oct 2023 13:28:46 +0100
| Newsgroups | gmane.emacs.ess.general |
|---|---|
| Message-ID | <[email protected]> |
I have been meaning to reply to this for some time and maybe a partial answer now is better than a complete answer in several months time.
I use envrc https://github.com/purcell/envrc with direnv https://direnv.net/ and nix https://nixos.org/. With these I can have a different R (and different packages) in each project I work on and emacs and any shells automatically pick up this version and required libraries. Just to be clear I can have different versions of R in different projects. I can also have different versions of packages in different projects. And ESS just picks them up without me configuring emacs.
For a project I am working on at the moment I have my R set up as
> let
> R-with-my-packages = nixpkgs.rWrapper.override{
> packages = with nixpkgs.rPackages; [
> ggplot2
> maps
> rnaturalearth
> rnaturalearthdata
> sf
> tidyverse
> ]; };
And all the dependencies for the R packages are made available (e.g. gdal, proj, geos, libtiff) automatically. In this example, I didn’t specify versions and let nix choose them for me so I got e.g ggplot 3.4.2 but I could have specified a different version e.g. a bug fixed version that hasn’t been released to CRAN.
Of course you can use this for much more than R.
PS I want to say thanks to everyone that contributes to ESS and provides help on this email channel. It’s a great tool :-)
Dominic Steinitz
[email protected]
http://idontgetoutmuch.org
Twitter: @idontgetoutmuch
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help