I tried another approach, and this one was also futile. <br><br><div><font class="Apple-style-span" face="'courier new', monospace">try{</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> int size = argTypes.getColumnCount();</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> std::vector<RObject> inputVectors;</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> inputVectors.reserve(3);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> StringVector nameVec(size); </font></div><div><font class="Apple-style-span" face="'courier new', monospace"> NumericVector lenVec(size) ;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> NumericVector scaleVec(size) ;</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> </font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"> for (size_t i = 0; i < size; ++i) {</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> //get the datatype</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> Type vt = argTypes.getColumnType(i);</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> DataOID BDOid = vt.getTypeOid();</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> //convert the Oid to string name</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> std::string columnType = Oid2String(BDOid);</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> //get the length for string types, precision for time and numerics and scale for numerics</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> int length = 0;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> int scale= 0;</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> getTypeLength(vt, length, scale);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> </font></div><div><font class="Apple-style-span" face="'courier new', monospace"> nameVec[i] = columnType.c_str();</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> lenVec[i] = length;</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> scaleVec[i] = scale; </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> }</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> </font></div><div><font class="Apple-style-span" face="'courier new', monospace"> inputVectors.push_back(nameVec);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> inputVectors.push_back(lenVec);</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> inputVectors.push_back(scaleVec);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> //create the dataframe</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> Rcpp::List df;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> df.push_back(inputVectors[0],"datatype");</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> df.push_back(inputVectors[1],"length");</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> df.push_back(inputVectors[2],"scale");</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> Rcpp::DataFrame df_final = Rcpp::DataFrame::create(df);</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> return df_final;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> }</font></div><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 10:33 AM, Pratibha Rana <span dir="ltr"><<a href="mailto:pratibha.r.tomar@gmail.com" target="_blank">pratibha.r.tomar@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I can only create std::vectors. The list::create also fails. <div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">
On Mon, Jun 4, 2012 at 6:48 PM, Steve Lianoglou <span dir="ltr"><<a href="mailto:mailinglist.honeypot@gmail.com" target="_blank">mailinglist.honeypot@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Mon, Jun 4, 2012 at 6:02 PM, Dirk Eddelbuettel <<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>> wrote:<br>
><br>
> On 4 June 2012 at 17:28, Pratibha Rana wrote:<br>
</div>[snip]<br>
<div><br>
> | The value of res was printed at line 159 in Vector__create.h . Using Wrap()<br>
> | makes it worse. I really need help. I have been trying to do this for 2 days<br>
> | now.<br>
<br>
> What about the working example I just to the list?<br>
><br>
> What about the following adapted from the unit test file for dataframes:<br>
<br>
</div>Or, if you're really in dire straits and assuming you've got the list<br>
you want to convert to a data.frame built already: you can just pass<br>
it back to R and convert it w/ `as.data.frame`.<br>
<br>
This will allow you to move on w/ getting the rest of the things you<br>
need to work done and you can revisit this later when you're out of<br>
the woods.<br>
<span><font color="#888888"><br>
-steve<br>
<br>
--<br>
Steve Lianoglou<br>
Graduate Student: Computational Systems Biology<br>
| Memorial Sloan-Kettering Cancer Center<br>
| Weill Medical College of Cornell University<br>
Contact Info: <a href="http://cbio.mskcc.org/~lianos/contact" target="_blank">http://cbio.mskcc.org/~lianos/contact</a><br>
</font></span></blockquote></div><br>
</div></div></blockquote></div><br>