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

Matthew Dowle mdowle at mdowle.plus.com
Tue Oct 30 15:40:57 CET 2012


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/
>



More information about the R-devel mailing list