Niels Richard Hansen
2010-Dec-11 07:23 UTC
[Rd] 'identical' and the warning "ignoring non-pairlist attributes"
Dear R developers Using the 'foreach' package I encounter warnings like Warning message: In identical(.combine, cbind) : ignoring non-pairlist attributes Warnings appear once in a new R-session when I run a particular piece of code - and not again. I understand from the source code of 'identical' that the function checks and believes that .combine and cbind have non-pairlist attributes, but I don't understand how this can be the case I have produced the following minimal example data.frame()[rep(1,1e6), ] library(foreach) identical(foreach:::defcombine, cbind) resulting in [1] FALSE Warning message: In identical(foreach:::defcombine, cbind) : ignoring non-pairlist attributes The warning is not related to the foreach package it seems. I get the same kind of warning with e.g. identical(spatial:::trmat, cbind) in a new R-session. Many other functions I have tried do, however, not result in the warning. The warning depends on the supposedly completely unrelated data frame operation. It seems also to be related to the fact that the data frame is empty and I extract a large number of columns out of this empty data frame. I would highly appreciate help on this to get rid of the warning in my own package. Thanks, Niels R version 2.12.1 RC (2010-12-10 r53825) Platform: i386-apple-darwin9.8.0/i386 (32-bit) locale: [1] C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] foreach_1.3.0 codetools_0.2-6 iterators_1.0.3 (or other attached packages: [1] spatial_7.3-2) -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor Email: Niels.R.Hansen at math.ku.dk Department of Mathematical Sciences nielsrichardhansen at gmail.com University of Copenhagen Skype: nielsrichardhansen.dk Universitetsparken 5 Phone: +1 510 502 8161 2100 Copenhagen ? Denmark
peter dalgaard
2010-Dec-11 10:23 UTC
[Rd] 'identical' and the warning "ignoring non-pairlist attributes"
On Dec 11, 2010, at 08:23 , Niels Richard Hansen wrote:> Dear R developers > > Using the 'foreach' package I encounter warnings like > > Warning message: > In identical(.combine, cbind) : ignoring non-pairlist attributes > > Warnings appear once in a new R-session when I run a > particular piece of code - and not again. I understand from > the source code of 'identical' that the function checks and > believes that .combine and cbind have non-pairlist attributes, but I > don't understand how this can be the case > > I have produced the following minimal example > > data.frame()[rep(1,1e6), ] > library(foreach) > identical(foreach:::defcombine, cbind) > > resulting in > > [1] FALSE > Warning message: > In identical(foreach:::defcombine, cbind) : > ignoring non-pairlist attributes > > The warning is not related to the foreach package it seems. I get > the same kind of warning with e.g. > > identical(spatial:::trmat, cbind) > > in a new R-session. Many other functions I have tried do, however, > not result in the warning. The warning depends on the supposedly completely > unrelated data frame operation. It seems also to be related to the > fact that the data frame is empty and I extract a large number of > columns out of this empty data frame. I would highly appreciate help > on this to get rid of the warning in my own package.Hm, I think you might have tickled a buglet here. I can debug it down to a comparison of two CHARSXPs, both having CHARSXP attributes. I'm a getting a little rusty on debugging at that level, but I don't think CHARSXPs are supposed to _have_ attributes in any meaningful context, so perhaps identical() just shouldn't check. On the other hand, it could also be the sign of a memory overrun in the preceding memory-intensive operation. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
Reasonably Related Threads
- Can't load "doSMP" from REvolutionR in regular R2.11.0
- Debugging segfault in foreach
- The permutation of one vector into another
- How to assign NULL value to pairlist element while keeping it a pairlist?
- How to assign NULL value to pairlist element while keeping it a pairlist?