Hi, I am writing software for individual survival predictions of patients in visual basics 6. I use R(d)com (2.5) to perform calculations in R (2.7.1)within VB. With read.table and sink I am able to import and export data and outcome. I use the survival library to do some calculations like multivariate analysis. All went fine until yesterday.......In the final step of my calculations, I use the following code:
(dataR is a dataset with 1300 patients) *Set p = CreateObject("StatConnectorSrv.StatConnector") p.Init "R" Set d = CreateObject("StatConnTools.StringLogDevice") d.BindToServerOutput p* *p.EvaluateNoReturn "(library (survival))"* *p.EvaluateNoReturn "dataR <-read.table ('c:\\test.txt', header=T)"* *p.EvaluateNoReturn "test.mod <- coxph (Surv(TOTTIJD, DOOD)~(T) + (N) + (M), data=dataR)"* *p.EvaluateNoReturn "plot(survfit(lumc))"* *p.EvaluateNoReturn "patient<-data.frame (T=1, N=0, M=1)"* *p.EvaluateNoReturn "plot(survfit(test.mod,newdata=patient))"* In the RGUI the code written above (without : p.EvaluateNoReturn and double quotes) works fine. In VB6 all lines do work proparly except the last line. This last line gives a run-time error. *2147221493 (8004000b) Method 'EvaluateNoReturn' of object Istatconnector Failed* ** I already tried a lot of tricks to solve my problem but it drives me creazy at the moment. My first question is: am I doing something wrong? My second question: is it possible to run this last line with the r(d)com connection or do I need to use another application or connection tool? My last question: can r(d)com handle the data.frame object? (I do suppose so since the read.table works fine). Thank you very much, Marciano Ferrier
_______________________________________________ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at