1
$\begingroup$

I have a r installation on a server machine and have mathematica on my laptop. I have been using DatabaseLink to connect to the remote sql server and performing queries. I would now like to use mathematica on my machine to connect with r installation on the remote machine to pass codes from here and get results from the remote r installation. This is necessary as i don't have a lot of RAM on my machine. I know about RLink but can't find instruction to connect to a remote installation.

Somebody please help.

$\endgroup$
1
  • $\begingroup$ Installing R using the Shared link suggested by Edmund works fine except it is not running R on the server but on the local machine. Is there a way to connect to R running on the server thereby using the resources of the server rather than the local machine. $\endgroup$
    – user13892
    Jun 8, 2017 at 20:25

1 Answer 1

2
$\begingroup$

You may be able to use InstallR with the "RHomeLocation" option if you are on a Windows OS.

Needs["RLink`"]
InstallR["RHomeLocation"->"\\\\servername\\sharename\\path to R_HOME of R Distrtribution"]

"RHomeLocation" works for local installations of R but I have not tried it for remote installations of R. There are a few more InstallR options that you should consider as well. Also have a read of the RLink User Guide as you may have to run RLinkResourcesInstall. It also gives information on how to optimise calls and data transfer between R and Mathematica.

Hope this helps.

$\endgroup$
4
  • $\begingroup$ if you can guide me how to point to the remote server. In my remote desktop application i am able to access it with computer name tm46:10346 and the location of r installation on that system is C:\Program Files\R\R-3.2.4revised. How path exactly should i use? I tried before to import a file but the path never worked. $\endgroup$
    – user13892
    Jun 1, 2017 at 11:40
  • $\begingroup$ @user13892 You need to setup the folder as a shared folder on your network which will allow you to choose the name. Perhaps you should share the R directory so you can connect to different revisions. If you call the share RRevisions, then the command would be InstallR["RHomeLocation" -> "\\\\tm46:10346\\RRevisions\\R-3.2.4revised"] $\endgroup$
    – Edmund
    Jun 1, 2017 at 13:15
  • $\begingroup$ It is able to locate the folder now but still i am getting this error, InstallR::fail: Failed to install R. The following error was encountered: Unable to load dynamic libraries $\endgroup$
    – user13892
    Jun 2, 2017 at 7:23
  • $\begingroup$ Ok it is working fine now. But it is using the RAM of my local system in which i have mathematica rather than the server where the r resides. $\endgroup$
    – user13892
    Jun 6, 2017 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.