Message Boards Message Boards

Any hope to support external R distribution on Mac?

Even with the newly released version 11.3, Mathematica on a Mac (or, apparently, under Linux) still does not allow using an external R distribution.

Is there some strong technical reason why support for an external R distribution is currently provided only for Windows?

POSTED BY: Murray Eisenberg
5 Replies

I would like to see this added too. Supporting an external R into which we can install arbitrary packages is an absolute necessity. Without access to R packages, there's little point in calling R from Mathematica at all.

I wrote a blog post about how to use external R installations on Mac (and other platforms), but the procedure is a bit messy:

You can use it as a workaround until this gets fixed.

POSTED BY: Szabolcs Horvát

We have been lucky by using the description by Szabolcs Horvat:

http://szhorvat.net/pelican/setting-up-rlink-for-mathematica.html

It comes "at-your-own-risk" but seems to work just fine. Please find a notebook that we used in a lecture attached. It uses the ggplot2 package and a glm package. The myData.csv file is from this website: https://stats.idre.ucla.edu/r/dae/logit-regression/

Best wishes,

Marco

Attachments:
POSTED BY: Marco Thiel

Thanks for the pointer to Horvat's material.

It's unclear if his method requires leaving SIP disabled. If so, then this rather awkward workaround would be unsatisfactory for me on security grounds. If not, then it's worth a try.

But still no excuse for WRI not having added support on platforms other than Windows.

POSTED BY: Murray Eisenberg

When I posted my last message, Marco's was not yet visible for some reason. As soon as my post went through, two more messages appeared immediately. The forum engine behind Wolfram Community really needs a bugfix update too ...

To answer Murray's question:

You have a choice:

  • You can either disable SIP (which I did not even try myself, for the reasons you mention, thus I haven't been able to verify that it works)
  • Or you can patch libjri.jnilib. This is what I do. It's a bit more involved though.
POSTED BY: Szabolcs Horvát

@Marco: Just a note that if you patch libjri.jnilib, it is no longer necessary to set DYLD_LIBRARY _PATH. The whole reason why we need to patch this file is that with SIP enabled, DYLD_LIBRARY _PATH will no longer influence which shared libraries get loaded.

POSTED BY: Szabolcs Horvát
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract