From mdowle at mdowle.plus.com  Tue Oct 30 15:40:57 2012
From: mdowle at mdowle.plus.com (Matthew Dowle)
Date: Tue, 30 Oct 2012 14:40:57 -0000
Subject: [Rd] There is pmin and pmax each taking na.rm, how about psum?
In-Reply-To: <CABdHhvFqn2ESQ1YtsuyN=_9-uO9VsT6ttVLo8d1cC+k-w=9o9Q@mail.gmail.com>
References: <b7c77d7038af15f6c18a37eadd00b4df.squirrel@webmail.plus.net>
	<CABdHhvFqn2ESQ1YtsuyN=_9-uO9VsT6ttVLo8d1cC+k-w=9o9Q@mail.gmail.com>
Message-ID: <0b7ca5941b68e0f3ba2a39a18f1b6199.squirrel@webmail.plus.net>


Not pdiff because i) psum(x,-y,na.rm=TRUE) would do that and ii) diff is
quite unlike -. Yes, pprod too, but not pdiv (or precip) because
pprod(x,y^-1,na.rm=TRUE) would dominate that.

> what about equivalent functions for ^, %%, %/%, &, and | ?

I like the suggestion, but not as useful as psum and pprod. It would
probably be going too far to add those too. Plus in ?groupGeneric, under
section 3, there are 7 functions listed :

    min, max, sum, prod, range, all, any

The p* would be extended to 2 more of those 7. Wouldn't make sense for
prange, pall or pany.  So, just psum and pprod. ^, %%, %/%, &, and | are
listed in section 2, Group "ops" and seem different to sum and prod in
that sense.


>> Is there a case to add psum? Or have I missed something.
>
> If psum, then why not pdiff (-), pprod (*) and precip (/) ?  And
> similarly, what about equivalent functions for ^, %%, %/%, &, and | ?
>
> Hadley
>
> --
> RStudio / Rice University
> http://had.co.nz/
>



[Rd] There is pmin and pmax each taking na.rm, how about psum?
Matthew Dowle