Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Diesel

Diesel fuel prices in 1999-2000 in nine regions of the country


Description

Data for Exercise 2.8

Usage

Diesel

Format

A data frame/tibble with 650 observations on three variables

date

date when price was recorded

pricepergallon

price per gallon (in dollars)

location

a factor with levels California, CentralAtlantic, Coast, EastCoast, Gulf, LowerAtlantic, NatAvg, NorthEast, Rocky, and WesternMountain

Source

Energy Information Administration, National Enerfy Information Center: 1000 Independence Ave., SW, Washington, D.C., 20585.

References

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.

Examples

par(las = 2)
boxplot(pricepergallon ~ location, data = Diesel)
boxplot(pricepergallon ~ location, 
       data = droplevels(Diesel[Diesel$location == "EastCoast" | 
       Diesel$location == "Gulf" | Diesel$location == "NatAvg" | 
       Diesel$location == "Rocky" | Diesel$location == "California", ]), 
       col = "pink", main = "Exercise 2.8")
par(las = 1) 
## Not run: 
library(ggplot2)
ggplot2::ggplot(data = Diesel, aes(x = date, y = pricepergallon, 
           color = location)) + 
           geom_point() + 
           geom_smooth(se = FALSE) + 
           theme_bw() + 
           labs(y = "Price per Gallon (in dollars)")

## End(Not run)

BSDA

Basic Statistics and Data Analysis

v1.2.0
GPL (>= 2)
Authors
Alan T. Arnholt [aut, cre], Ben Evans [aut]
Initial release
2017-07-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.