Skip to content
Prev 21475 / 63424 Next

Patch to allow negative argument in head() and tail()

Le Mardi 18 Juillet 2006 04:42, Martin Maechler a ?crit?:
Indeed, I did not pay that much attention to the second paragraph.

For me, this usage of head() and tail() is, at first, completely unintuitive 
since I more used to, say, "start from the beginning (head) of the vector and 
drop the first n elements" than "return the end of the vector except the 
first n elements". But I must agree your convention does make sense!
So I should rephrase the message as "n should be a vector of length 1", then.
Actually, this will no longer be needed since head() will always return, well, 
the head of an object, hence no need to relabel the lines of a matrix.
I'll give it a go in the next couple of days.

Bye!    Vincent