[R] Concatenation, was Re: Physical Units in Calculations

Stavros Macrakis macrakis at alum.mit.edu
Mon Apr 13 19:49:33 CEST 2009


On Mon, Apr 13, 2009 at 5:15 AM, Peter Dalgaard
<p.dalgaard at biostat.ku.dk> wrote:
> Stavros Macrakis wrote:
>> ...c of two time differences is currently a numeric vector,
>> losing its units (hours, days, etc.) completely.
>
> That's actually a generic feature/issue of c(). ...

> There is some potential for redesigning this, using a concat() generic which
> should do the Right Thing for all classed vector-like objects. (There is
> such a function in Splus, but I don't their data frame code is using it.)

That would be a very good thing. The current design is very confusing
and difficult to learn for new users, especially for factors.

I would be very happy to have a 'logical' concatenation as well as a
'physical' one.  For instance, I'd expect the levels of factors to be
merged: concat(factor(1:3),factor(3:4)) should be
factor(c(1,2,3,3,4)), not c(1,2,3,1,2).

         -s




More information about the R-help mailing list