cars93 | R Documentation |
A data frame with 54 rows and 6 columns. This data is a subset of the
Cars93
dataset from the MASS
package.
cars93
A data frame with 54 observations on the following 6 variables.
The vehicle type with levels large
, midsize
,
and small
.
Vehicle price (USD).
Vehicle mileage in city (miles per gallon).
Vehicle drive train with levels 4WD
, front
,
and rear
.
The vehicle passenger capacity.
Vehicle weight (lbs).
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.
Lock, R. H. (1993) 1993 New Car Data. Journal of Statistics Education 1(1).
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.