Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-10-29 Thread Jan Gorecki
Gabriel, My view is rather radical. - head/tail should return object having same number of dimensions - data.frame should be a special case - matrix should be handled as 2D array P.S. idea of accepting `n` argument as a vector of corresponding dimensions is a brilliant one On Wed, Oct 30, 2019 a

Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-10-29 Thread Gabriel Becker
Hi all, So I've started working on this and I ran into something that I didn't know, namely that for x a multi-dimensional (2+) array, head(x) and tail(x) ignore dimension completely, treat x as an atomic vector, and return an (unclassed) atomic vector: > x = array(100, c(4, 5, 5)) > dim(x) [1]