Reputation: 45
V1 V2
P1 1
P1 2
P1 3
P1 4
P1 2
P1 3
P1 4
P2 0
P2 3
P1 1
P3 1
P3 5
Hi all, I wanted to filter out rows from dataset B that contain P1 only (along with the variable V2) to a new table. I've tried
filter(str_detect(B$V1, "P1"))
and `B[grep("P1", rownames(B)), ]
and both doesn't work. It turned out to execute O obs. Thanks! `
Upvotes: 0
Views: 867