I am interested in identifying individuals that go from a 0 to a .5 or a 1. Here is example data:
id x
1 0
1 1
1 1
2 0
2 .5
2 .5
3 0
3 0
I want a new df that indicates whether or not each person moved from a 0 to .5 or 1. Something like this;
id endorsed
1 TRUE
2 TRUE
3 FALSE
I tried using ifelse for this, but I just can't get the code right. Does anyone have any suggestions?