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

Heat

Primary heating sources of homes on indian reservations versus all households


Description

Data for Exercise 1.29

Usage

Heat

Format

A data frame/tibble with 301 observations on two variables

fuel

a factor with levels Utility gas, LP bottled gas, Electricity, Fuel oil, Wood, and Other

location

a factor with levels American Indians on reservation, All U.S. households, and American Indians not on reservations

Source

Bureau of the Census, Housing of the American Indians on Reservations, Statistical Brief 95-11, April 1995.

References

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

Examples

T1 <- xtabs(~ fuel + location, data = Heat)
T1
barplot(t(T1), beside = TRUE, legend = TRUE)

## Not run: 
library(ggplot2)
ggplot2::ggplot(data = Heat, aes(x = fuel, fill = location)) + 
           geom_bar(position = "dodge") + 
           labs(y = "percent") + 
           theme_bw() + 
           theme(axis.text.x = element_text(angle = 30, hjust = 1)) 

## 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.