The file “STAT8010\_2022\_assignment2.csv” contains data for your second assignment. The dataset
captures the details of how CO2 emissions of a vehicle can vary depending on the different features
of each vehicle. The sample is taken from a Canada Government official open data website
(https://open.canada.ca/data/en/dataset/98f1a129-f628-4ce4-b24d-6f16bf24dd64#wb-auto-6). The
dataset contains information for a total of 7,385 models. There are 12 columns showing information
for the different models. The description of the headings is as follows:
-
Manufacturer: 42 different car makers
-
Model: sample models from each car maker
-
Vehicle Class: 16 categories of vehicle
depending on the size and type of the vehicle
-
Engine Size (L): size of the engine of the vehicle
in litres ranging from 0.9 to 8.4
-
Cylinders ( # of cylinders): number of cylinders
from 3 to 16
-
Transmission: Indicates Manual/Automatic and
number of gears
-
Fuel Type: fuel used for the vehicle
-
Fuel Consumption City (L/100 km): City
consumption
-
Fuel Consumption Hwy (L/100 km):
Highway consumption
-
Fuel Consumption Comb (L/100 km):
Combined consumption
-
Fuel Consumption Comb (mpg): combined
consumption in miles per gallon
-
CO2 Emissions(g/km)
The abbreviations used for the different types of transmissions and fuel are the following:
-
Transmission:
A = Automatic
AM = Automated manual
AS = Automatic with select shift
AV = Continuously variable
M = Manual
3 - 10 = Number of gears
-
Fuel Type:
X = Regular gasoline
Z = Premium gasoline
D = Diesel
E = Ethanol (E85)
N = Natural gas
You must read this data into R and complete a number of tasks.
Collapse the levels of the following categorical variables into fewer categories as indicated next:
-
Class of vehicle: (reduce to 7 categories) "Compact", "Tourism", "Van", "Pickup", "Special",
"SUV" and "Sport" vehicles.
-
Transmission: collapse into either “Manual” or “Automatic” transmission
Modify the name of the variables to something you consider more appropriate for the application.
1) Build a Shiny app or dashboard allowing a plot for any combination of two variables to be
displayed.
a. If two numerical variables are selected by the user, a scatterplot should be shown.
b. If one categorical variable and one numerical variable are chosen, the app should instead
display an appropriate boxplot.
user