How To Use The Aggregate Function In R