Skip to content
Prev 31141 / 63424 Next

x <- 1:2; dim(x) <- 2? A vector or not?

Martin Maechler wrote:
Brevity is good, but clarity is important too.   The output of str is 
usually decipherable, but not so much in this case.  It's easy to 
dismiss suggestions like replacing "chr" with "character" - the increase 
in clarity would be minimal.  However, the potential increase in clarity 
for a 1-d array is significant - the decrease in brevity is at question 
here. Given the rarity of the case it seems like a decent tradeoff to 
add "(1d-array)" (one could even just write "(1d)").   1-d arrays are 
sufficiently rare that no concise and clear method of indicating them 
using brackets or other symbols has arisen. You did say you "can be 
convinced to change" it, but I won't attempt beyond this! :-)

best,

Tony Plate