search for: cumbersum

Displaying 1 result from an estimated 1 matches for "cumbersum".

Did you mean: cumbersume
2010 Mar 29
1
Suggestion: Adding quick rowMin and rowMax functions to base package
...t calculate the min or max over rows / cols in a matrix. While apply(x,1,min) works, I found out by profiling a program of mine that it is rather slow for matrices with a very large number of rows. A quick functionality seems to be already there in the functions pmax and pmin, but it is rather cumbersume to apply them to all columns of a matrix (if one does not know how many columns the matrix has). Below, I have some code that shows a very unelegant implementation that illustrates possible speed gains if apply could be avoided: rowMin = function(x) { # Construct a call pmin(x[,1],x[,2],....