I am using Matlab 7.8.0 (R2009b) and R version 2.9.0 in Windows XP and it does not work. I have tried all the recomendations above and nothing works, I get the message:
??? Error using ==> openR at 68
Cannot connect to R.
Error: The remote procedure call failed.
Thanks
Hi,
I had the same problem as others. My command was:
a=[1,1,1,2,2,2,3,3,4,4];
b=[1,1,1,2,2,2,3,3,4,4];
putRdata('a',a)
putRdata('b',b);
evalR('c<-fisher.test(a,b)$p.value')
And the result was the error:
'Problem evaluating command c<-fisher.test(a,b)$p.value.
Invoke Error, Dispatch Exception: Object is static; operation not allowed'
My solution was to 'write' down the command to add the data. Then it worked perfectly.
In my case:
X=num2str(a);
X=strrep(X,' ',',');
eval(['evalR(''a<-c(' X ')'')'])
X2=num2str(b);
X2=strrep(X2,' ',',');
eval(['evalR(''b<-c(' X2')'')'])
evalR('c<-fisher.test(a,b)$p.value')
I thought this (ugly) trick might help some people here.
Sébastien
4
10 Jan 2012
MATLAB R-link
Functions for calling the statistical package R from within MATLAB.
Seems to me that only functions which don't require a data.frame type object work with this link. Eg, if I want to set up a regression, then project it over new data using the 'predict' function in R - no joy (I just get the fitted values over the original data).
Also, fitting a regression with categorical variables - no joy.
Can anyone confirm for me whether this is right please? I'd be very happy if I was wrong and I just need to change something in my set up to achieve the above.
G
4
14 Dec 2011
MATLAB R-link
Functions for calling the statistical package R from within MATLAB.
I am among those who report the error:
Invoke Error, Dispatch Exception: Object is static; operation not allowed
I am able to run this:
openR
a = 1:10;
putRdata('a',a)
b = evalR('a^2')
evalR('b <- a^2');
evalR('c <- b + 1');
c = getRdata('c')
without error, yet, upon running a function from the package known as `seacarb' I get the aforementioned error. I don't suppose anyone has made progress with this?
Chris
Comment only
16 Nov 2011
MATLAB R-link
Functions for calling the statistical package R from within MATLAB.
Comment only