Displaying 1 result from an estimated 1 matches for "only_b".
Did you mean:
only_
2013 Apr 24
2
Looking for a better code for my problem.
...want to select a subset of that 'Dat', for which:
1. First column will contain ALL "A"
2. First column will contain those "B" for which "BB = b" in second column.
Therefore I tries following:
> Only_A <- Dat[Dat[, 'AA'] == "A", ]
> Only_B <- Dat[Dat[, 'AA'] == "B", ]
> rbind(Only_A, Only_B[Only_B[, 'BB'] == "b", ])
AA BB CC
2 A c 2
4 A b 4
10 A a 10
11 A a 11
18 A b 18
19 A b 19
20 A c 20
3 B b 3
5 B b 5
8 B b 8
However I believe there must be some better c...