I have a dataset as follows
Pt EVENT
123 GGG
123 Nor
123 tre
144 GGG
1667 tre
1667 Nor
1667 tre
I want to group_by and then the data as per my previous question according to Pt but I am only interested in creating groups which contain Nor so the final dataset should be
Pt
123 GGG Nor tre
1667 tre Nor tre
I have the answer from the previous question but I can't seem to only select specific groups. This is what I have tried but it gives me
Sankey<-EndoSubset %>%
group_by(Pt) %>%
filter(EVENT == "Nor")
but obviously this just gives me rows containing Nor whereas I want all the rows for Pt
that contains Nor