How can I use RLink with R 3.5 (the latest version) on macOS?
I believe that Mathematica has huge potential as a glue language, and that links to other systems, like RLink, are not only very useful, but essential. Sadly, RLink was never fully finished, despite what Wolfram marketing might tell you. RLink is simply useless without the ability to connect to an external R installation into which packages can be installed. This ability was never officially supported on macOS.
There were workarounds though, and I set up a webpage that described them. But as new RLink and macOS versions were released, the workarounds became more complicated and using RLink more difficult. Originally it was enough to point RLink to a different R installation. Later, it needed to be patched to use the correct shared libraries. After that, its runtime started crashing on first use, and would only work on the second try. Wolfram was notified of all these problems, but still didn't dedicate RLink the resources necessary to fix this.
Now with R 3.5, RLink is finally not usable, and I was unable to find any more workarounds. The runtime always crashes on
InstallR. Because of the above-mentioned webpage, two people have already contacted me asking for new workarounds, but I couldn't help them. So now I'm asking here.
Is there any way to use RLink with R 3.5 on macOS?
Steps to reproduce the problem:
- Install R 3.5, the latest version as of this writing.
- Patch RLink with
install_name_tool, as described at the end of this page
Start up RLink using
<< RLink` InstallR["RHomeLocation" -> "/Library/Frameworks/R.framework/Resources", "RVersion" -> 3]
Now the runtime crashes.