[R] R API call from delphi

Duncan Temple Lang duncan at wald.ucdavis.edu
Thu Sep 8 19:53:03 CEST 2005


On approach is to create a native/foreign interface to R by
linking R as a library (libR.a and R.dll) file and
calling the C routines in the library to
    i) initialize the R interpreter
   ii) call an R function

We have done this with many languages and the procedure is well
understood at this point, but requires some C-level programming
and converting between the standard data types of both systems.

Another approach is to use R via DCOM.  There are two different
approaches to this. One has the R interpreter as the DCOM
server and the client (the Delphi application here) would send
R commands to that server. The other approach has regular
DCOM servers that are implemented via R functions.  (The
ability to send R commands is a simple case of this.)  It is up
to you to define the servers via a few extra lines of R code.

I would suggest you pursue the DCOM route unless you are
keen to do the necessary work to embed the R  library
in Delphi and deal with some technical details about
calling conventions of C routines.

  D

Laurent TESSIER wrote:
> Hello,
> Has anyone tried to call R API from Delphi under windows ? How was it done if it was ? Or has anyone any idea about how it could be done ?
> Thanks for your answers
> Laurent Tessier
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list