I have a data frame ModelDF
having columns with numeric as well as character values like:
Quantity Type Mode Company
1 Shoe hello Nike
1 Shoe hello Nike
2 Jeans hello Levis
3 Shoe hello Nike
1 Jeans hello Levis
1 Shoe hello Adidas
2 Jeans hello Spykar
1 Shoe ahola Nike
1 Jeans ahola Levis
I have to aggregate it in this form
Quantity Type Mode Company
5 Shoe hello Nike
3 jeans hello Levis
1 Shoe hello adidas
2 jeans hello Spykar
1 Shoe ahola Nike
1 jeans ahola Levis
i.e. I have to aggregate and sum Quantity if all other columns are same.
I have tried it using aggregate
but as it doesn't work on character values it is giving me wrong results.
What are my options? Thanks