Ms Qiao,

On 10 April 2011 14:24, Wendy <wendy2.qiao@gmail.com> wrote:

> I have a huge matrix of TRUE/FALSE table like following, and I want to
> count
> the number of TRUEs in each row. Instead of looping through each row and do
> length(Z[Z==TRUE]), I am wondering if there is an easier way of doing this.
>
>       [,1]   [,2]    [,3]
> [1,]TRUE FALSE FALSE
> [2,]FALSE TRUE TRUE
>

Does this help...
Z[Z==T]
?

-- 
Sent from my mobile device
Envoyait de mon telephone mobil

	[[alternative HTML version deleted]]

