I need to write a script in R (Rstudio) that produces a new table, with 6 rows, that aggregates the vehicle types in cars dataset. In the first field will be the type of vehicle (sports car, SUV, Wagon, Minivan, Pickup, regular), (regular, this is when everyone is zero (, and then there are the averages per value for each type of vehicle.
The table should look like this :
Type | Wheel base | Weight | HWY MPG | city MPG | HP | Cyl | Engine size | Dealer cost | Retail price |
---|---|---|---|---|---|---|---|---|---|
Regular | |||||||||
Sport car | |||||||||
... |