December 14th, 2006, 10:36 am
Hi,I am an R newbie and have the following question - is it possible to pass VBA Arrays rather than using ranges on the actual sheet?A concrete example may help . Taking the demo regression function:'*************************** Call Rinterface.StartRServer Call Rinterface.PutArray("x1", Range("Regression!A2:A26")) Call Rinterface.PutArray("x2", Range("Regression!B2:B26")) Call Rinterface.PutArray("y", Range("Regression!C2:C26")) Call Rinterface.GetArray("lm(y~x1+x2)$coefficients", Range("Regression!F2")) Call Rinterface.StopRServer'**************************is it possible to pass/return using VBA arrays rather than having to use the excel spreadsheet? Something like: Call Rinterface.StartRServer Call Rinterface.PutArray("x1", input1) Call Rinterface.PutArray("x2", input2) Call Rinterface.PutArray("y", input3) Call Rinterface.GetArray("lm(y~x1+x2)$coefficients", output) Call Rinterface.StopRServerThanks.