Mathematica and R
Sage and Marc, thank you for your helpful replies. Since RLink enables R calls from Mathematica, I wonder if it would make the Mathematica "Front End" useful for organizing R work even if no Mathematica functions are needed. It would be nice R had something like the "Front End," a GUI that enables Mathematica users to easily keep commands, output, and plots in the same file. Best regards, David
On 10-07-14 10:24, Marc Schwartz wrote:
On Jul 14, 2010, at 6:59 AM, David Bickel wrote:
What are some effective ways to leverage the strengths of R and Mathematica for the analysis of a single data set?
More specifically, are there any functions that can assist with any of the following?
1. Calling an R function from Mathematica.
2. Calling a Mathematica function from R.
3. Using XML or another reliable data format to pass vectors, matrices, and/or lists from one environment to the other.
Any advice would be appreciated.
David
See: http://www.scienceops.com/Rlink2.asp http://library.wolfram.com/infocenter/Conferences/6510/ Those provide hints on calling R from Mathematica using a commercial application (Windows Vista only apparently). It would seem, logically, that the commercial world (SAS, SPSS, etc.) has deemed it more important to provide R functionality from within their applications, than vice versa. If Mathematica can be run in a batch mode using a CLI interface, it may be possible to call Mathematica from within R using the system() function. However, parsing the results of the Mathematica operation in R will be up to you. Similarly, if Mathematica has the ability to call external batch files, you could run R code in that fashion, again, having to deal with parsing the results in Mathematica. In so far as moving data back and forth, you can review the R Data Import/Export manual: http://cran.r-project.org/doc/manuals/R-data.html to identify common formats (eg. CSV files) that can be used by both applications. I don't use Mathematica, so am unfamiliar with their, presumably proprietary, formats. HTH, Marc Schwartz