[R] do.call() and aperm()

Gabor Grothendieck ggrothendieck at myway.com
Tue Oct 21 19:22:28 CEST 2003



I suggest following APL as that is a well thought out system.
In APL terms there are two operations here called:

- catenation. In abind, this occurs when along = 1,2,...,length(dim)
- lamination.  In abind, this occurs when along = length(dim) + 1

however, the latter is really only one case of lamination in 
which the added dimension comes at the end.  To do it in full
generality would require that one can add the new dimension
at any spot including before the first, between the first and
the second, ..., after the last.

In APL notation, if along has a fractional part then the new
dimension is placed between floor(along) and ceiling(along).
Thus along=1.1 would put the new dimension between the first
and second.  The actual value of the fractional part is not material.

---
From: Tony Plate <tplate at blackmesacapital.com>
 
I've also been thinking about how to specify that 'along' should be 
length(dim)+1. At the moment one can specify any number from 0 up to 
length(dim)+1, but as you point out you have to spell out length(dim)+1 as 
the value for the along argument. It would possible to make abind() 
automatically calculate along=length(dim)+1 when given along=NA, or 
along=-1, or along="+1". Any preferences?

-- Tony Plate



_______________________________________________
No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com




More information about the R-help mailing list