Jim,

The next step for understanding what happens is to subset a complicated
expression
 and see what its sub-pieces are doing.
Since
  apply(a[!is.na(a)],2,sum)
doesn't work, start by looking at each of the arguments to apply.
You already verified that
  !is.na(a)
gives what you want.  Now take the next step and see that
  a[!is.na(a)]
doesn't give what you want.

Looking at nested sets of sub-expressions is the key to learning R.

Rich

	[[alternative HTML version deleted]]

