<br><font size=2 face="sans-serif">Hi Davor. </font>
<br>
<br><font size=2 face="sans-serif">Thanks for your response. Yes, the problem
is the creation of an embedded R instance inside a method. </font>
<br><font size=2 face="sans-serif">Attached there is a simplified example
of the way i tried. </font>
<br>
<br><font size=2 face="sans-serif">As a context, i'm using NOMAD (http://www.gerad.ca/nomad/Project/Home.html),
an optimization tool where the constraints are functions created in R.
These constraints must be created in the method called eval_x. </font>
<br>
<br><font size=2 face="sans-serif">Please help. </font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Davor Cubranic <cubranic@stat.ubc.ca></b>
</font>
<p><font size=1 face="sans-serif">17/03/2011 05:03 p.m.</font>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Para</font></div>
<td valign=top><font size=1 face="sans-serif">CESAR PERNALETE <pernaletec@pdvsa.com></font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top><font size=1 face="sans-serif">rcpp-devel@r-forge.wu-wien.ac.at</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Asunto</font></div>
<td valign=top><font size=1 face="sans-serif">Re: [Rcpp-devel] R Embedded
in a class function</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>If you have some specific code, that would help. If
you by "class function" you mean to ask "is it possible
to create an embedded R instance inside a method?", then the answer
is "yes". But there are several things you may be doing incorrectly,
and seeing your code would mean we can address the one that is the problem.<br>
<br>
Davor<br>
<br>
<br>
On 2011-03-17, at 2:11 PM, CESAR PERNALETE wrote:<br>
<br>
> I need to embed an R function in a class function. I have seen in
all of the examples that the embed of R always is made in the main function.
It possible to do it in a class function? <br>
> How would be? <br>
> <br>
> I tried to do it, and first argc, argv variables were expected. Then
i assigned values to this variables in this way: <br>
> <br>
> const char *agv = "./main"; //No parameters are needed
by the main function <br>
> int agc = 1; <br>
> RInside R(agc,&agv); // create an embedded R instance <br>
> <br>
> In this case no error were found at compiling, but the embed didn't
work. <br>
> <br>
> If some of you have some idea i would appreciate your help. <br>
<br>
</tt></font>
<br>