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@jhmi.edu<mailto:rvaradhan@jhmi.edu> 410-502-2619 [[alternative HTML version deleted]]
On Thu, Apr 19, 2012 at 06:12:30PM +0000, Ravi Varadhan wrote:> 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.[...] Not sure if the performance of apply is so much of a problem, but also from a view of consistency of the provided functions, I think offering such functions would make it more clear and consitent to use R here, because all those functions are then available for row and col and the functionality is appended in the name (Mean, Sum etc.). I think the basic things that should be available woud be: - mean - median - min - max - var - sd If both then are available for rows and columns, this would be fine. Ciao, Oliver
On Thu, Apr 19, 2012 at 08:31:56PM +0200, oliver wrote:> On Thu, Apr 19, 2012 at 06:12:30PM +0000, Ravi Varadhan wrote: > > 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. > [...] > > Not sure if the performance of apply is so much of a problem, > but also from a view of consistency of the provided > functions, I think offering such functions would make > it more clear and consitent to use R here, because > all those functions are then available for row and col > and the functionality is appended in the name (Mean, Sum etc.). > > I think the basic things that should be available woud be: > > - mean > - median > - min > - max > - var > - sd- sum :-) - diff Ciao, Oliver
S+ has such functions with a slightly different naming convention: it puts an 's' after each function. E.g., colMaxs instead of your colMax. "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
Hi Ravi, rowMin and rowMax are available in the Biobase package (available from BioConductor). Best, Holger -------- Original-Nachricht --------> Datum: Thu, 19 Apr 2012 18:12:30 +0000 > Von: Ravi Varadhan <rvaradhan at jhmi.edu> > An: "r-devel at r-project.org" <r-devel at r-project.org> > Betreff: [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--