cars04 | R Documentation |
A data frame with 428 rows and 19 columns. This is a record of characteristics on all of the new models of cars for sale in the US in the year 2004.
cars04
A data frame with 428 observations on the following 19 variables.
The name of the vehicle including manufacturer and model.
Logical variable indicating if the vehicle is a sports car.
Logical variable indicating if the vehicle is an suv.
Logical variable indicating if the vehicle is a wagon.
Logical variable indicating if the vehicle is a minivan.
Logical variable indicating if the vehicle is a pickup.
Logical variable indicating if the vehicle is all-wheel drive.
Logical variable indicating if the vehicle is rear-wheel drive.
Manufacturer suggested retail price of the vehicle.
Amount of money the dealer paid for the vehicle.
Displacement of the engine - the total volume of all the cylinders, measured in liters.
Number of cylinders in the engine.
Amount of horsepower produced by the engine.
Gas mileage for city driving, measured in miles per gallon.
Gas mileage for highway driving, measured in miles per gallon.
Total weight of the vehicle, measured in pounds.
Distance between the center of the front wheels and the center of the rear wheels, measured in inches.
Total length of the vehicle, measured in inches.
Total width of the vehicle, measured in inches.
library(ggplot2)
# Highway gas mileage
ggplot(cars04, aes(x = hwy_mpg)) +
geom_histogram(
bins = 15, color = "white",
fill = openintro::IMSCOL["green", "full"]
) +
theme_minimal() +
labs(
title = "Highway gas milage for cars from 2004",
x = "Gas Mileage (miles per gallon)",
y = "Number of cars"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.