Construct a dichotomous variable + calculate YOY growth with a dataset with multiple companies and multiple years.

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. It's time consuming to reverse engineer problems