How to sum multiple column using aggregate function (formula method) ? I am trying to work following code;
aggregate(cty,hwy ~ class+ Manufacturer, data = mpg, mean)
it should give me sum of hwy, sum of cty by manufacturer and class
How to sum multiple column using aggregate function (formula method) ? I am trying to work following code;
aggregate(cty,hwy ~ class+ Manufacturer, data = mpg, mean)
it should give me sum of hwy, sum of cty by manufacturer and class