Abilene: Crimes reported in Abilene, Texas

Description Usage Format Source Examples

Description

Data used in Exercise 1.23 and 2.79

Usage

1

Format

A data frame with 16 observations on the following 3 variables.

CrimeType

a factor with levels Aggravated assault Arson Burglary Forcible rape Larceny theft Murder Robbery Vehicle theft

Year

a factor with levels 1992 and 1999

Number

number of reported crimes

Source

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Duxbury

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
par(mfrow = c(2, 1))
barplot(Abilene$Number[Abilene$Year=="1992"], 
names.arg = Abilene$CrimeType[Abilene$Year == "1992"], 
main = "1992 Crime Stats", col = "red")
barplot(Abilene$Number[Abilene$Year=="1999"], 
names.arg = Abilene$CrimeType[Abilene$Year == "1999"],
main = "1999 Crime Stats", col = "blue")
par(mfrow = c(1, 1))

## Not run: 
library(ggplot2)
ggplot(data = Abilene, aes(x = CrimeType, y = Number, fill = Year)) + 
geom_bar(stat = "identity", position = "dodge") +
theme_bw() + 
theme(axis.text.x = element_text(angle = 30, hjust = 1))

## End(Not run)

alanarnholt/simplemathr documentation built on May 10, 2019, 8:49 a.m.