<div dir="ltr">Maybe not. I think a function in library should do only one thing, and for DataFrame::create it is building a data.frame. If the users wish to convert string to factor, one should do it explicitly, may with a help function such as `stringsToFactor` or `as.factor`. <span style="font-family:arial,sans-serif;font-size:13px">stringsAsFactor is an important feature at R side, but does RCpp have to match the exact interface of R?</span><div>

<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font face="arial, sans-serif">For now, RCpp doesn't really support factor. Returning a data.frame with factor element would make it useless for RCpp.</font></div>

<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Hi Romain,</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I'm curious about the difference between the code on SVN and the old one. I read the code, and understand the new one is using List, while the old one actually call something like as.data.frame(data.frame(t1, t2, ...)) on R side. I just don't know why one would work while the other doesn't.</font></div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 2, 2013 at 10:16 AM, Romain Francois <span dir="ltr"><<a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le 02/04/13 17:01, Dirk Eddelbuettel a écrit :<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 2 April 2013 at 16:36, Romain Francois wrote:<br>
| Le 29/03/13 16:37, Dirk Eddelbuettel a écrit :<br>
| ><br>
| > On 29 March 2013 at 16:20, <a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a> wrote:<br>
| > | Cool. I'll have a look when I'm back from easter weekend.<br>
| ><br>
| > Sounds good.<br>
| ><br>
| > And that point, it would be really nice if you could also restore the ability<br>
| > to build Rcpp, which appears to have broken with your Data.Frame patch.<br>
| ><br>
| > Details are below.<br>
|<br>
| Should be back up now. With new versions of DataFrame::create that work<br>
| better.<br>
<br>
Nice.<br>
<br>
And it builds, but doesn't pass (all) tests yet:<br>
<br>
checking tests ...<br>
   Running ‘doRUnit.R’ [185s/193s]<br>
  ERROR<br>
Running the tests in ‘tests/doRUnit.R’ failed.<br>
Last 13 lines of output:<br>
   Executing test function test.wstring_param  ...  done successfully.<br>
<br>
<br>
<br>
   Executing test function test.wstring_return  ...  done successfully.<br>
<br>
   saving txt unit test report to '/home/edd/svn/rcpp/pkg/Rcpp.<u></u>Rcheck/tests/Rcpp-unitTests.<u></u>txt'<br>
   saving html unit test report to '/home/edd/svn/rcpp/pkg/Rcpp.<u></u>Rcheck/tests/Rcpp-unitTests.<u></u>html'<br>
   Error in eval(expr, envir, enclos) :<br>
     unit test problems: 1 failures, 0 errors<br>
   Error in checkEquals(<u></u>createTwoStringsAsFactors(), DF, msg = "DataFrame create2 stringsAsFactors = false") :   Length mismatch: comparison on first 2 componentsComponent 2: 'current' is not a factorDataFrame create2 stringsAsFactors = false<br>

   Calls: source -> withVisible -> eval -> eval<br>
   Execution halted<br>
<br>
<br>
Does it for you?<br>
</blockquote>
<br></div></div>
Aah. No it does not.<br>
<br>
This is not supported by the new code:<br>
<br>
DataFrame::create(<br>
                _["a"] = v,<br>
                _["b"] = s,<br>
                _["stringsAsFactors"] = false );<br>
<br>
I forgot that we support this and ran the tests just before making that change.<br>
<br>
Do we really need this feature ?<div class="im HOEnZb"><br>
<br>
-- <br>
Romain Francois<br>
Professional R Enthusiast<br>
<a href="tel:%2B33%280%29%206%2028%2091%2030%2030" value="+33628913030" target="_blank">+33(0) 6 28 91 30 30</a><br>
<br>
R Graph Gallery: <a href="http://gallery.r-enthusiasts.com" target="_blank">http://gallery.r-enthusiasts.<u></u>com</a><br>
<br>
blog:            <a href="http://blog.r-enthusiasts.com" target="_blank">http://blog.r-enthusiasts.com</a><br>
|- <a href="http://bit.ly/ZTFLDo" target="_blank">http://bit.ly/ZTFLDo</a> : Simpler R help tooltips<br>
`- <a href="http://bit.ly/YFsziW" target="_blank">http://bit.ly/YFsziW</a> : R Help tooltips<br>
<br></div><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-<u></u>project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-<u></u>project.org/cgi-bin/mailman/<u></u>listinfo/rcpp-devel</a></div></div></blockquote></div><br>
</div>