I have a function that spits out a matrix, such as:
x freq
1 FALSE 40
2 TRUE 6
but when there are no FALSE values, I get
x freq
1 TRUE 46
I want to extract the freq value when x=TRUE. If there are are always both FALSE and TRUE values, I can do
> matrix [2,2]
[1] 6
But I would like to be able to extract the TRUE value whether or not there are FALSE values. Does anyone know how I can do that? Thanks in advance!
See Question&Answers more detail:os