[R] R.matlab anyone ?

Alexander Nervedi alexnerdy at hotmail.com
Tue May 9 05:09:12 CEST 2006


Hi

I have some code up and runnning in Matlab and need it for some stuff better 
handled in R. So R.matlab sounded terrific. However, I am having trouble 
getting it to go.
I am using R v 2.2.1 (i know i know i need to upgrade), and Windows XP and 
Matlab 6.0.0.88 (R12).

here is what I get.
# in R GUI
>library(R.matlab)
Loading required package: R.oo
R.oo v1.1.6 (2006-04-03) successfully loaded. See ?R.oo for help.
R.matlab v1.1.1 (2006-01-21) successfully loaded. See ?R.matlab for help.
>Matlab$startServer()
Loading required package: R.utils
R.utils v0.7.7 (2006-03-30) successfully loaded. See ?R.utils for help.
[1] 0

#

However, Matlab does open up on seperate window, but with an error message. 
This reads,

  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.

??? Error: File: C:\R\R-2.2.1\MatlabServer.m Line: 109 Column: 45
")" expected, "identifier" found.



So I went to MatlabServer.m  and found that

108 if (port < 1023 | port > 49151)
109  error('Cannot not open connection. Port ('MATLABSERVER_PORT') is out of 
range [1023,49151]: %d', port);
110 end

(the numbers are the line numbers).  my guess is that I haven't been able to 
connect and the 0 i see from within R is a sign of this.  Can anyone advice 
me as to what is going on. I feel there is something missing - i can get the 
matlab command window to come up but .... the connection i guess is not 
there.

Any ideas would be really helpful.

Alex.




More information about the R-help mailing list