I'm replying here to quite an old thread started by me.
I think the dimnames facility is underused in R.
I'm currently using a 5-dimensional array. It is quite cumbersome to have to
write
y[0]
Since the array does have dimnames, I would like to be able to say instead
y[tree=0]
Below is a
I think that the dimname names of tables and arrays could make
aperm() and apply() (and probably some other functions) easier to use.
(dimname names are, for example, created by table() )
The use would be something like:
--
x -table( from=sample(3,100,rep=T), to=sample(5,100,rep=T))
trans - x /
It's not that simple. These are base functions so
- adding utility functions to base is undesirable
- efficiency matters
- any change (including adding a function!) needs corresponding
documentation.
- this needs much better error checking.
- dimnum.from.dimnamename is rather inefficient: a