Hey all.
I just popped project bluefin onto a framework 13 laptop a day or two ago, and I’m working to set it up. I’m a statistician and I mostly code in R (via emacs and emacs-speaks-statistics).
I’ve installed R via homebrew (brew install r) and I am now trying to install the r packages from CRAN.
I’m getting this following error:
install.packages("data.table")
Installing package into ‘/var/home/linuxbrew/.linuxbrew/lib/R/4.4/site-library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'); using local file '/home/linuxbrew/.linuxbrew/Cellar/r/4.4.3_1/lib/R/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository https://ftp.osuosl.org/pub/cran/src/contrib:
cannot open URL 'https://ftp.osuosl.org/pub/cran/src/contrib/PACKAGES'
Warning messages:
1: In download.file(url, destfile = f, quiet = TRUE) :
URL 'https://cran.r-project.org/CRAN_mirrors.csv': status was 'SSL peer certificate or SSH remote key was not OK'
2: package ‘data.table’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
I haven’t used homebrew much before, but I’ve been reading about this for most of the evening and it seems like it is often suggested that users avoid installing R with homebrew exactly because of difficulties with R package installation.
So, I think my questions are:
-
Am I missing something obvious that will make homebrew R on PB work nicely?
-
Is there a better way for me to be installing R on PB? I believe one option would be for me to install and set up emacs + R in a container. I tested this out a bit by spinning up a fedora container using buddybox, installing R with
dnfand then installing packages, all which seemed to work. I also haven’t used containers much and I would prefer to have a solution that didn’t involve regularly spinning up a container. This emacs + R setup is where I spend a significant amount of my time each day and it seems to me that it would have less friction if I had the combination working using flatpak and homebrew.
So far PB has been great and I like a lot of the concepts behind it (thanks devs!) but if I can’t get this to work cleanly for me then I’ll have to find a different distro solution.
thanks,
Aaron
EDIT: since I selected a solution, the thread was locked before I could post an update and thank the responders. Here’s what I was drafting when it was locked:
thanks @stego and @JohnAtl , your suggestions worked like a charm.
the distrobox with arch allowed me to use pacman to install all the system libraries I need (I do a lot of spatial work, and sometimes getting relevant system libs installed and linked up with R can be a pain), R, and emacs. I exported both the R bin and the Emacs app to the system, as you each suggested, and all is working. I can run R from within emacs, read/write to my directories and dropbox, and I can installing R packages, in emacs, etc.
Very slick. Thanks for all the pointers.
