Message Boards Message Boards

2
|
8722 Views
|
11 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Why still cannot use own R distribution on Mac?

Mathematica on Windows has for some time allowed using InstallR to install one's own R distribution instead of the curated Wolfram provided version. But not on other platforms, including Mac

Still in Mathematica 12.1, only Windows is supported for such user-provided R distributions.

Why is that facility still not supported on Mac (and other platforms)?

What is the impediment?

POSTED BY: Murray Eisenberg
11 Replies

Can somebody tell me how to install the rJava package?

I tried using the Package Installer of R.app. If I first try to get a package list from CRAN there, I get a " unable to access index for repository" error. And if I simply search for rJava in the Package Installer search field, nothing seems to happen.

Next, I found rJava at CRAN online and downloaded the rJava_0.9-13.tgz, which is supposed to be the latest Mac binary for the package. So in the R.app console I executed command:

install.packages("rJava_0.9-13.tgz",lib="/Users/murray/Downloads",repos=NULL)

But I got error:

tar: Error opening archive: Failed to open 'rJava_0.9-13.tgz'
Error: file ‘rJava_0.9-13.tgz’ is not a macOS binary package

Now what?

POSTED BY: Murray Eisenberg

I was able to install rJava (in /Library/Frameworks/R.framework/Resources/library) by the using RStudio app instead of the R app.

POSTED BY: Murray Eisenberg
POSTED BY: Murray Eisenberg

The problem must be specific to Catalina.

I tried it with Mojave (10.14) before posting, and there it works. Indeed it must be a security issue. Unfortunately, I cannot upgrade to Catalina because some of the programs I use are not compatible.

POSTED BY: Szabolcs Horvát
POSTED BY: Mark Dowdeswell

I tried Szabolcs' "Note for R version 3.5 (and possibly later) on macOS" using Mathematica 12.1.1 under macOS Catalina 10.15.6, but with the current R, namely, R 4.0. The commands used were:

Needs["RLink`"]
JLink`UninstallJava[];
InstallR[
 "RVersion" -> 4,
 "RHomeLocation" -> "/Library/Frameworks/R.framework/Resources",
 "NativeLibLocation" -> 
  "/Library/Framewworks/R.framework/Resources/library/rJava/jri"
 ]

The last one failed with error:

InstallR::fail: Failed to install R. The following error was encountered: Unable to load dynamic libraries
POSTED BY: Murray Eisenberg

What exactly is the step JLinkUninstallJava[ ]` of Szabolcs method doing — and why?

POSTED BY: Murray Eisenberg

I installed R 4.0.2 (for the first time), and got the same error that you did. After I ran install.packages("rJava") (in RStudio), everything worked for R4 as it did for me for R3 (as far as I can tell).

Perhaps try re-install the rJava package?

POSTED BY: Mark Dowdeswell

@Murray, you are probably aware of these workarounds (scroll to the bottom): http://szhorvat.net/pelican/setting-up-rlink-for-mathematica.html

POSTED BY: Szabolcs Horvát

My colleague reported this issue to Wolfram support back in February. The Prerelease team said older versions of R were working on their computers. They sent the information over to the developers though. I don't think we've heard back since then. Sorry I don't have anything more useful than that to add.

POSTED BY: Eric Smith
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