[R] Method 'EvaluateNoReturn' of object 'IStatConnector' failed
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sat Jul 19 19:01:44 CEST 2003
On Sat, 19 Jul 2003, Neil Osborne wrote:
> I am using the R ActiveX component (v1.2). I have written a custom function
> in R which returns a dataframe. I want to be able to retrieve the contents
> of the returned dataframe in my application.
>
> Here is a snippet of the code (line that throws exception). X has been
> correctly declared and init'ed earlier on in the code.
>
>
> x.EvaluateNoReturn("results_frame <- MyFunction()")
That is not a valid R command: underline is not part of a syntactically
valid name and has been made defunct (in the development version which
will become 1.8.0). Depending on your version of R this will be an error
or give a warning and mean
results <- frame <- MyFunction()
> I was intending to then invoke the GetSymbol method to retrieve the contents
> of results_frame into a local variable.
Won't work as there cannot be such a variable name (unquoted).
> I notice that this still dosen't work if I try to use the Evaluate method to
> directly assign the returned dataframe to my local variable.
>
>
> My questions can thus be summarised as ff:
> 1). How do I call a custom function written in R, using the R ActiveX
> library. ?
> 2). How do I access a dataframe returned from a function call, using the R
> ActiveX library. ?
> 3). Can I / How do I pass arguments into a function (including datframes)
> using the R ActiveX library. ?
In all cases, the same way you do at R's command line. So do check your
scripts at the command line where you will get more informative error
messages and recover options.
[...]
--
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
More information about the R-help
mailing list