If you work with both Matlab and R, the R.matlab package maintained by Henrik Bengtsson on CRAN helps you to connect the two environments by allowing you to read and write Matlab's MAT data file format from R (even if you don't have Matlab installed). This allows you to pass data between Matlab and R via the filesystem.

But if you want to build an integrated R/Matlab workflow, and call Matlab functions directly from R, there is also the reach package by Christoph Schmidt (available on Github). The reach package works with a Matlab installation behind the scenes, by writing scripts for batch execution by Matlab, and exchanging data via files. (This is a simpler integration than the beta Java-based connectivity also provided by R.matlab, but Christoph claims this interface is more robust.) This is all transparent to the user though, who with just R functions is able to:

- call and execute Matlab functions seamlessly as if they were R functions and return their results directly into the R session
- convert .mat files into .RData files, and even batch-convert all .mat files contained within a folder
- launch Matlab scripts, and import the results back into R
- execute Matlab functions and print their results at the command line
- exchange list and matrix objects between the two systems

I don't have access to Matlab, so I wasn't able to try R.matlab or the "reach" packagage myself. But if you try it out, let us know how it works.

github (schmidtchristoph): reach