[Rd] Column(row)wise minimum and maximum

William Dunlap wdunlap at tibco.com
Thu Apr 19 22:14:35 CEST 2012

S+ has such functions with a slightly different naming convention:
it puts an 's' after each function.  E.g., colMaxs instead of your

 "colMaxs"      "colMeans"     "colMedians"   "colMins"      "colProds"    
 "colQuantiles" "colRanges"    "colStdevs"    "colSums"      "colVars"     
 "rowMaxs"   "rowMeans"  "rowMins"   "rowRanges" "rowStdevs" "rowSums"   "rowVars"  

It also has a similar family of functions with 'col'/'row' replaced by 'group'
to handle common calls to tapply(split(x,group),summaryFunc)
  "groupAlls"       "groupAnys"       "groupMaxs"       "groupMeans"      "groupMins"      
  "groupProds"      "groupRanges"     "groupStdevs"     "groupSums"       "groupVars"    
and lower level versions of those called "igroup<Summarys>" where the
group vector must be a vector of small positive integers (like tabulate's
input, while the 'group<Summarys>' are like table and coerce group to be
a factor).

They certainly don't need to be in the base product, but they are handy.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com

> -----Original Message-----
> From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org] On Behalf
> Of Ravi Varadhan
> Sent: Thursday, April 19, 2012 11:13 AM
> To: r-devel at r-project.org
> Subject: [Rd] Column(row)wise minimum and maximum
> Hi,
> Currently, the "base" has colSums, colMeans.  It seems that it would be useful to extend
> this to also include colMin, colMax (of course, rowMin and rowMax, as well) in order to
> facilitate faster computations for large vectors (compared to using apply).  Has this been
> considered before?  Please forgive me if this has already been discussed before.
> Thanks,
> Ravi
> Ravi Varadhan, Ph.D.
> Assistant Professor
> The Center on Aging and Health
> Division of Geriatric Medicine & Gerontology
> Johns Hopkins University
> rvaradhan at jhmi.edu<mailto:rvaradhan at jhmi.edu>
> 410-502-2619
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list