Conda for R dependencies
On Linux conda CRAN doesn’t support binary packages, which means that you need to compile the packages from source. This works but is kind of slow and annoying. I have tried to use the r packages on conda-forge as a way to get compiled R packages on linux and I have to say that overall works quite well.
This is especially useful as I want to have separate enviroments for different projects and I don’t want to compile the same packages over and over again.
R packages on conda have a r- prefix so for example you can do: pixi add r-tidyverse 1 to install the tidyverse package.
There are many packages that are avaiable on CRAN but not on conda-forge and for those you still need to do install them the old way (for this pak::pak is a great tool). In this scenario is great that you can install compilers and libraries using conda, so you don’t depend on the system enviroment that you may not control or may have the wrong version. One thing to consider is that to install packages you need to make sure to activate the conda enviroment, or translated I am using R inside vscode and I have setup the R interpreter to ${worksspace}/.pixi/bin/R which works great except that it doesn’t activate the enviroment, which means that if I try to compile packages it doesn’t work. Executing R with pixi run R works great.