<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 &nbsp;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. &nbsp;</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 &lt;cubranic@stat.ubc.ca&gt;</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 &lt;pernaletec@pdvsa.com&gt;</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 &quot;class function&quot; you mean to ask &quot;is it possible
to create an embedded R instance inside a method?&quot;, then the answer
is &quot;yes&quot;. 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>
&gt; 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>
&gt; How would be? <br>
&gt; <br>
&gt; I tried to do it, and first argc, argv variables were expected. Then
i assigned values to this variables in this way: <br>
&gt; <br>
&gt; const char *agv = &quot;./main&quot;; &nbsp;//No parameters are needed
by the main function <br>
&gt; int agc = 1; <br>
&gt; RInside R(agc,&amp;agv); &nbsp;// create an embedded R instance <br>
&gt; <br>
&gt; In this case no error were found at compiling, but the embed didn't
work. <br>
&gt; <br>
&gt; If some of you have some idea i would appreciate your help. <br>
<br>
</tt></font>
<br>