[Rcpp-devel] Bug with table sugar and NumericVector in Rcpp 0.10.3

Chenliang Xu luckyrand at gmail.com
Tue Apr 2 20:04:30 CEST 2013


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`. stringsAsFactor is an important
feature at R side, but does RCpp have to match the exact interface of R?

For now, RCpp doesn't really support factor. Returning a data.frame with
factor element would make it useless for RCpp.

Hi Romain,

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.


On Tue, Apr 2, 2013 at 10:16 AM, Romain Francois
<romain at r-enthusiasts.com>wrote:

> Le 02/04/13 17:01, Dirk Eddelbuettel a écrit :
>
>
>> On 2 April 2013 at 16:36, Romain Francois wrote:
>> | Le 29/03/13 16:37, Dirk Eddelbuettel a écrit :
>> | >
>> | > On 29 March 2013 at 16:20, romain at r-enthusiasts.com wrote:
>> | > | Cool. I'll have a look when I'm back from easter weekend.
>> | >
>> | > Sounds good.
>> | >
>> | > And that point, it would be really nice if you could also restore the
>> ability
>> | > to build Rcpp, which appears to have broken with your Data.Frame
>> patch.
>> | >
>> | > Details are below.
>> |
>> | Should be back up now. With new versions of DataFrame::create that work
>> | better.
>>
>> Nice.
>>
>> And it builds, but doesn't pass (all) tests yet:
>>
>> checking tests ...
>>    Running ‘doRUnit.R’ [185s/193s]
>>   ERROR
>> Running the tests in ‘tests/doRUnit.R’ failed.
>> Last 13 lines of output:
>>    Executing test function test.wstring_param  ...  done successfully.
>>
>>
>>
>>    Executing test function test.wstring_return  ...  done successfully.
>>
>>    saving txt unit test report to '/home/edd/svn/rcpp/pkg/Rcpp.**
>> Rcheck/tests/Rcpp-unitTests.**txt'
>>    saving html unit test report to '/home/edd/svn/rcpp/pkg/Rcpp.**
>> Rcheck/tests/Rcpp-unitTests.**html'
>>    Error in eval(expr, envir, enclos) :
>>      unit test problems: 1 failures, 0 errors
>>    Error in checkEquals(**createTwoStringsAsFactors(), DF, msg =
>> "DataFrame create2 stringsAsFactors = false") :   Length mismatch:
>> comparison on first 2 componentsComponent 2: 'current' is not a
>> factorDataFrame create2 stringsAsFactors = false
>>    Calls: source -> withVisible -> eval -> eval
>>    Execution halted
>>
>>
>> Does it for you?
>>
>
> Aah. No it does not.
>
> This is not supported by the new code:
>
> DataFrame::create(
>                 _["a"] = v,
>                 _["b"] = s,
>                 _["stringsAsFactors"] = false );
>
> I forgot that we support this and ran the tests just before making that
> change.
>
> Do we really need this feature ?
>
>
> --
> Romain Francois
> Professional R Enthusiast
> +33(0) 6 28 91 30 30
>
> R Graph Gallery: http://gallery.r-enthusiasts.**com<http://gallery.r-enthusiasts.com>
>
> blog:            http://blog.r-enthusiasts.com
> |- http://bit.ly/ZTFLDo : Simpler R help tooltips
> `- http://bit.ly/YFsziW : R Help tooltips
>
> ______________________________**_________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-**project.org<Rcpp-devel at lists.r-forge.r-project.org>
> https://lists.r-forge.r-**project.org/cgi-bin/mailman/**
> listinfo/rcpp-devel<https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130402/6a67f814/attachment-0001.html>


More information about the Rcpp-devel mailing list