You do not need 2 calls to rowMeans . You can perform the subtraction first and call rowMeans on the result.
x1 <- rowMeans(m[,ind1])-rowMeans(m[,ind2]) x2 <- rowMeans(m[,ind1]-m[,ind2]) all.equal(x1,x2) # [1] TRUE
is.data.frame is part of the checks performed in rowMeans .
UPDATE: Regarding .rowMeans in R-devel, it looks like it's just a direct call to the internal code (assuming do_colsum n't changed). It is defined as:
.rowMeans <- function(X, m, n, na.rm = FALSE) .Internal(rowMeans(X, m, n, na.rm))
In your case, m=1024 and n=1000 .
source share