From murdoch.duncan at gmail.com  Fri Jul 18 19:24:38 2014
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Fri, 18 Jul 2014 12:24:38 -0500
Subject: [Rd] request of information about creating DLL from R to be
 used in other languages/programs
In-Reply-To: <002b01cfa29d$1d66df40$58349dc0$@rennes.inra.fr>
References: <002b01cfa29d$1d66df40$58349dc0$@rennes.inra.fr>
Message-ID: <53C95856.5000209@gmail.com>

On 18/07/2014, 10:29 AM, Ludovic Brossard wrote:
> Hello
> 
>  
> 
> My question is the following. I have tried to find a similar subject in
> archives but not found (perhaps bad search!) and I tried R-help and I was
> advised that R-devel would perhaps better for my question
> 
>  
> 
> So I wonder if it is possible to create a dll from a R code to use it in
> another language/program.
> 
> Indeed, one of my colleague wrote a R code combining some R functions to
> create a method of calculation.
> 
> I would want to use this method in a program coded in Delphi.
> 
>  
> 
> Is there possibilities to create a DLL from R code to be called in the
> Delphi program ?
> 
> It would allow us to avoid rewriting code and searching correspondence
> between R functions and Delphi program (or other types of tools as TPMath).
> 
> Is it possible to call a dll form R whereas R is not installed on the
> computer?
> 
>  
> 
> I hope to be clear in my demand an I hope you will be able to give me some
> indications or where to find it.
> 


Most of this is possible, but not easy.  See chapter 8 of the "Writing R
Extensions" manual.  You are essentially writing a new "front-end" to R,
and it will require R to be installed for it to work.

Many years ago I wrote instructions for using Delphi to create a DLL for
R to use, which is another approach you could try.  I've no idea how
obsolete those instructions are nowadays, but they might give you some
starting points:

http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/pascal.html

Duncan Murdoch

>  
> 
> Best regards
> 
>  
> 
> Ludovic Brossard
> 
>  
> 
>  
> 
>  
> 
> Ludovic BROSSARD
> 
> UMR PEGASE (Physiologie, Environnement et G?n?tique pour l?Animal et les
> Syst?mes d?Elevage)
> 
> INRA ? Agrocampus Ouest
> 
> Domaine de la Prise, 35590 Saint-Gilles, France
> 
> T?l : 33 (0)2 23 48 70 57 . Fax : 33(0)2 23 48 50 80
> 
>  <http://www.rennes.inra.fr/pegase> www.rennes.inra.fr/pegase.  
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> 
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] request of information about creating DLL from R to be used in other languages/programs
Duncan Murdoch