0

The Matlab toolbox 'Matlab coder' allows you to generate ANSI C source code (as long as it does not involve any sophisticated toolboxes – at least for now).

Given this discussion:

SO disussion

I understand that R can also produce (at least?) 'object' files from R (version greater 2.13). I presume these could also be linked later to build an executable.

Is this correct? What is the advantage of Matlab coder over R’s ‘standard functionality’? Any clarification would be very much appreciated. Many thanks in advance.

Community
  • 1
  • 1
cs0815
  • 16,751
  • 45
  • 136
  • 299

1 Answers1

2

As far as I know there is currently no way of making R code executable (e.g., transforming to a win exe file). That is your presumption of the possibility of building executables is wrong. Hence, if Matlab can do it, this is the advantage over R.

Henrik
  • 14,202
  • 10
  • 68
  • 91
  • Did you read the above link? I maybe missing something but there are approaches (possibly even part of R now) which allow you to create ANSI C code from R. I do not see a problem to create an executable under windows or indeed any other operating system given ANSI C code. – cs0815 Jun 19 '12 at 11:42
  • 1
    That is just compiling R code within R itself, it still needs the whole R system to work – mdsumner Jun 19 '12 at 12:28
  • like @mdsumner says, you are misinterpreting the capabilities of the `compiler` package. It does not compile to ANSI C but to R byte code (whatever this means). – Henrik Jun 19 '12 at 12:42
  • But R is extremely extensible and you can add C, C++, ObjC or Fortran code "on the fly" via the inline package. Go read "Writing R Extensions". – Dirk Eddelbuettel Jun 19 '12 at 13:45