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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to