A data frame with 54 rows and 6 columns. This data is a subset of the
Cars93 dataset from the MASS package.
Format
A data frame with 54 observations on the following 6 variables.
- type
The vehicle type with levels
large,midsize, andsmall.- price
Vehicle price (USD).
- mpg_city
Vehicle mileage in city (miles per gallon).
- drive_train
Vehicle drive train with levels
4WD,front, andrear.- passengers
The vehicle passenger capacity.
- weight
Vehicle weight (lbs).
Details
These cars represent a random sample for 1993 models that were in both
Consumer Reports and PACE Buying Guide. Only vehicles of type
small, midsize, and large were include.
Further description can be found in Lock (1993). Use the URL http://jse.amstat.org/v1n1/datasets.lock.html.
Examples
library(ggplot2)
# Vehicle price by type
ggplot(cars93, aes(x = price)) +
geom_histogram(binwidth = 5) +
facet_wrap(~type)
# Vehicle price vs. weight
ggplot(cars93, aes(x = weight, y = price)) +
geom_point()
# Milleage vs. weight
ggplot(cars93, aes(x = weight, y = mpg_city)) +
geom_point() +
geom_smooth()
#> `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
