Re: [Rd] Using 'dimname names' in aperm() and apply()

2012-04-20 Thread ghostwheel
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

[Rd] Using 'dimname names' in aperm() and apply()

2010-07-29 Thread Michael Lachmann
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 /

Re: [Rd] Using 'dimname names' in aperm() and apply()

2010-07-29 Thread Prof Brian Ripley
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