I am trying to use R functions from my MATLAB code using a DCOM server. I am working under Windows XP. While I mange to run basic functions and run them using scripts, when I try a more complicated set of functions I fail. I am trying to perform survival analysis, using Surv Surv(recruTime,recur) Surv creates a somewhat complex output and I get the response Problem evaluating command source( "s:\\R&D\\matlab\\repository\\personalfolders\\moshe\\colon\\rcut.r"). Invoke Error, Dispatch Exception: Object is static; operation not allowed I tried to get around this by using a script, but it doesn't work. I do not actually want to transfer the Surv output back to MATLAB, but rather allow R to plot some graphs, actually Schoenfeld residuals, which works fine within R, but I can't work out if R can be instructed to perform this analysis by MATLAB Does anyone know how? Thanks! [[alternative HTML version deleted]]
Moshe Hoshen <moshe_ho <at> rosettagenomics.com> writes:> > I am trying to use R functions from my MATLAB code using a DCOM server. > I am working under Windows XP...> I am trying to perform survival analysis, using Surv > > Surv(recruTime,recur) > > Surv creates a somewhat complex output and I get the response > > Problem evaluating command source( > "s:\\R&D\\matlab\\repository\\personalfolders\\moshe\\colon\\rcut.r"). > > Invoke Error, Dispatch Exception: Object is static; operation not > allowedI am not using it with Matlab, but quite extensively with C#. The somewhat strange error message you noted "Object is static" has always been an error in the script. When I am sure that the script works Ok when run separately, it frequently has to do with the current directory being different when run with RDCOM and from GUI. Therefore I explicitly set the working directory at the top of all scripts, or get is from an environment string. The most helpful tool is a character device in my application that outputs the R string directly, so I immediately see what the cryptic "Object is static" means. Dieter
This is about 'a' DCOM server. You haven't told us which (there are at least two possibilities), but if it is the one by Thomas Baier it has its own mailing list. This is not an R issue (and I suspect not a MATLAB one either), so please try to use an accurate subject line. On Mon, 17 Mar 2008, Moshe Hoshen wrote:> I am trying to use R functions from my MATLAB code using a DCOM server. > I am working under Windows XP. > > While I mange to run basic functions and run them using scripts, when I > try a more complicated set of functions I fail. > > I am trying to perform survival analysis, using Surv > > Surv(recruTime,recur) > > > > Surv creates a somewhat complex output and I get the response > > Problem evaluating command source( > "s:\\R&D\\matlab\\repository\\personalfolders\\moshe\\colon\\rcut.r"). > > Invoke Error, Dispatch Exception: Object is static; operation not > allowed > > > > I tried to get around this by using a script, but it doesn't work. I do > not actually want to transfer the Surv output back to MATLAB, but rather > allow R to plot some graphs, actually Schoenfeld residuals, which works > fine within R, but I can't work out if R can be instructed to perform > this analysis by MATLAB > > Does anyone know how? > > Thanks! > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Dear Dieter Thanks I have my script working perfectly now, thanks to you Cheers -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Dieter Menne Sent: Monday, March 17, 2008 10:51 AM To: r-help at stat.math.ethz.ch Subject: Re: [R] driving R from MATLAB Moshe Hoshen <moshe_ho <at> rosettagenomics.com> writes:> > I am trying to use R functions from my MATLAB code using a DCOMserver.> I am working under Windows XP...> I am trying to perform survival analysis, using Surv > > Surv(recruTime,recur) > > Surv creates a somewhat complex output and I get the response > > Problem evaluating command source( > "s:\\R&D\\matlab\\repository\\personalfolders\\moshe\\colon\\rcut.r"). > > Invoke Error, Dispatch Exception: Object is static; operation not > allowedI am not using it with Matlab, but quite extensively with C#. The somewhat strange error message you noted "Object is static" has always been an error in the script. When I am sure that the script works Ok when run separately, it frequently has to do with the current directory being different when run with RDCOM and from GUI. Therefore I explicitly set the working directory at the top of all scripts, or get is from an environment string. The most helpful tool is a character device in my application that outputs the R string directly, so I immediately see what the cryptic "Object is static" means. Dieter ______________________________________________ R-help at 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.