Skip to content

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

10 messages · Romain Francois, Dirk Eddelbuettel, Chenliang Xu

#
Le 29/03/13 16:37, Dirk Eddelbuettel a ?crit :
Should be back up now. With new versions of DataFrame::create that work 
better.

  
    
#
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?
#
Le 02/04/13 17:01, Dirk Eddelbuettel a ?crit :
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 ?
#
On 2 April 2013 at 17:16, Romain Francois wrote:
| Do we really need this feature ?

I like to maintain existing APIs and interfaces.  

I haven't had time to look at how you now impletement the DataFrame ctor via
List -- but is there no way to catch that stringsAsFactor yes/no choice and
accomidate it?

This choice strikes me as a pretty central feature at the R side of things.

Dirk
#
Le 02/04/13 17:33, Dirk Eddelbuettel a ?crit :
Sure. I'm working on it now.
#
On 2 April 2013 at 17:37, Romain Francois wrote:
| Le 02/04/13 17:33, Dirk Eddelbuettel a ?crit :
| >
| > On 2 April 2013 at 17:16, Romain Francois wrote:
| > | Do we really need this feature ?
| >
| > I like to maintain existing APIs and interfaces.
| >
| > I haven't had time to look at how you now impletement the DataFrame ctor via
| > List -- but is there no way to catch that stringsAsFactor yes/no choice and
| > accomidate it?
| >
| > This choice strikes me as a pretty central feature at the R side of things.
| >
| > Dirk
| 
| Sure. I'm working on it now.

Super, thanks!

Dirk
#
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:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130402/6a67f814/attachment-0001.html>
#
Le 02/04/13 20:04, Chenliang Xu a ?crit :
We were calling

data.frame(t1, t2, ... )

Now we do:

as.data.frame( list(t1, t2, ...) )

(what actually happens is more complex as it deals with names)

  
    
#
Le 02/04/13 17:33, Dirk Eddelbuettel a ?crit :
Should be back to normal now.