In R, what is the most efficient/idiomatic way to count the number of TRUE values in a logical vector? I can think of two ways:
TRUE
z <- sample(c
Another option is to use summary function. It gives a summary of the Ts, Fs and NAs.
> summary(hival) Mode FALSE TRUE NA's logical 4367 53 2076 >