Defining connection between variables in R

Hi everybody,

I have a list with data about companies sales. Some of the companies are related to each other (they are sister companies), and share a parent entity. I want to aggregate the data for all this companies and have it appear in one row under the name of the parent entity.

The only solution I thought about so far was to change the names for all the sister companies to the name of the parent entity and than aggregate.

Is there a better way to define a connection (not a statistical connection) between these related companies?

Thanks in advance!

Create a new variable Parent and populate for each row. The group_by parent.