I want to add a year segment to clearly visualize each year category but failed to use if statement in it. Is it possible to use if in ggplot? If not, is there any better way to visualize it. Thanks.


I want to add a year segment to clearly visualize each year category but failed to use if statement in it. Is it possible to use if in ggplot? If not, is there any better way to visualize it. Thanks.

