I am tring to write a R code that compare two columns grouped by thier Id. My idea is to filter the column so it shows only ID that have been to both initial and review meeting.
This is how my data frame:
ID Initial Review Type
P40 Yes Meeting1
P40 Yes Meeting2
P42 Yes Meeting1
P42 No Meeting2
P43 Yes Meeting1
P43 Yes Meeting2
P44 Yes Meeting1
P44 No Meeting2
This is what I am trying to achieve:
ID Initial Review Type
P40 Yes Meeting1
P40 Yes Meeting2
P43 Yes Meeting1
P43 Yes Meeting2
Have tried using OR and AND logical operators. The OR gives me wrong result, with the AND I get empty data frame.
tt %>% group_by(ID) %>% filter(Initial == "Yes" & Review == "Yes")