Re: [Rd] Patch to allow negative argument in head() and tail()

From: Charles C. Berry <cberry_at_tajo.ucsd.edu>
Date: Wed 19 Jul 2006 - 16:19:47 GMT

On Wed, 19 Jul 2006, Martin Maechler wrote:

[most discussion of unix tail behavior deleted]

>
> I know that there is some "good" reason for the behavior of
> 'tail' in "Unix"
> { tail -3 === tail -n 3 and
> tail -3 === tail -n -3 }
>
> but of course, we can't be compatible here, because in S
> (and most reasonable languages :-)
> "3 == +3" and "3 != -3" !
>

Ahhh. But in R

         quote( foo( +n ) ) != quote( foo( n ) )

so if one was determined to emulate GNU Coreutils tail's behavior it ***could*** be done by using match.call to recover the explicit '+' or '-'.

But I shudder to think of the confusion that this approach might cause when n is an expression whose value is negative.

Chuck

Charles C. Berry                        (858) 534-2098
                                          Dept of Family/Preventive Medicine
E mailto:cberry@tajo.ucsd.edu	         UC San Diego
http://biostat.ucsd.edu/~cberry/         La Jolla, San Diego 92093-0717

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jul 20 02:22:11 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 19 Jul 2006 - 18:31:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.