RLink error with dynamic libraries on Mac 10.12 with Mathematica v11

 RLink error with dynamic libraries on Mac 10.12 with Mathematica v11

Yes, there have been a lot of questions on RLink (quite a few on just how to get it working or installing packages). However none directly address loading RLink on MacOS. Older questions Installing R packages using RLink on Mac OS X appear to somehow have RLink working.

When some posts have users with MacOS dealing with difficulty due to RLink, Szabolcs’ post on Setting up RLink for Mathematica has become the default response to these errors. (see here, here, etc)

Namely, it states (for MacOS):

Needs["RLink`"]
SetEnvironment["DYLD_LIBRARY_PATH" -> "/Library/Frameworks/R.framework/Resources/lib"];
InstallR["RHomeLocation" -> "/Library/Frameworks/R.framework/Resources", "RVersion" -> 3]

However, it is stated clearly in the documentation for InstallR:

“RHomeLocation” Automatic location of the root of an external R distribution (currently Windows only)

Running the SetEnvironment command does not seem to cause any errors.

Another previous question Does mathematica 9 on mac depend on these dynamic libraries? has an answer which states:

none of the direct dependencies lies under /usr/local

which, in the terminal, which R is under:/usr/local/bin/R. Honestly, I do not even know if that is relevant.

Does anyone have a fool-proof solution for using RLink on MacOS?

Let’s block ads! (Why?)

Recent Questions – Mathematica Stack Exchange