RDCOM can only return basic data types such as text and numbers and arrays of basic types. So you cannot use the command that return a complex type, eg _StatCon.Evalualte("lm(......)")
So how can I retrieve complex datatypes, such as models?
- If you know what value you need you can retrieve that one. eg pvalue by Evalualte("lm(......)$pvalue")
- Or by several steps to 'ask' what info is available
- for each string name in names ....
- val = StatCon.Evaluate("mymodel$"+name)
I have created classes that retrieve specific values for models and a RVar class that iterative retrieves all info in a complex data type
Error messages are not informative on the cause of the error, so how to get more info?
- Open the .RDatafile from R and try the command there
- Remember that you cannot return complex types
- Use a CharDevice. and print command, eg print(mymod<-lm(...)) Now the R results are as text available in the CharDevice