Skip to content
Prev 157016 / 398506 Next

rowSums()

On 9/24/2008 10:38 AM, Marc Schwartz wrote:
Based on the difference in behavior for Sums and Means, this might be
another possibility:

rowMeans(testDat, na.rm=TRUE) * rowSums(!is.na(testDat))

[1]  1 NA  6