From ripley at stats.ox.ac.uk  Sat Mar 27 09:03:05 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat Mar 27 09:03:09 2004
Subject: [Rd] cbind/rbind fail on matrixes containing lists (PR#6702)
In-Reply-To: <Pine.A41.4.58.0403261521310.46652@homer10.u.washington.edu>
Message-ID: <Pine.LNX.4.44.0403270801450.11650-100000@gannet.stats>

On Fri, 26 Mar 2004, Thomas Lumley wrote:

> On Fri, 26 Mar 2004, Thomas Lumley wrote:
> 
> >
> > Yep, bind.c:do_bind has
> >
> >     switch(mode) {
> >     case NILSXP:
> >     case LGLSXP:
> >     case INTSXP:
> >     case REALSXP:
> >     case CPLXSXP:
> >     case STRSXP:
> >         break;
> >     default:
> >         errorcall(call, "cannot create a matrix from these types");
> >     }
> >
> >
> > Looks like a fairly simple fix to me.
> 
> Not any more it doesn't.  bind.c:AnswerType puts lists together with
> pairlists and who knows what else in its `other' class, so a bit more
> thought and coding is needed.
> 
> It should be fairly straightforward, but it's not a localised change.

That's not the main problem area: the actual cbind code does not handle
vector lists.  I've treated it as a documentation fix / enhancement 
request.

Brian

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] cbind/rbind fail on matrixes containing lists (PR#6702)
Prof Brian Ripley