install.packages("ggplot2")
library(ggplot2)

custdata = read.csv(url("http://www.millerjw.com/dom/mgmt462/data/custdata.csv"))
str(custdata)
summary(custdata)
ggplot(custdata) +
  geom_histogram(aes(x=age),
                 binwidth=5, fill="gray")
library(scales)
ggplot(custdata) + geom_density(aes(x=income)) +
  scale_x_continuous(labels=dollar)

ggplot(custdata) + geom_density(aes(x=income)) +
  scale_x_log10(breaks=c(100,1000,10000,100000), labels=dollar) +
  annotation_logticks(sides="bt")

ggplot(custdata) + geom_bar(aes(x=marital.stat), fill="gray")

ggplot(custdata) +
  geom_bar(aes(x=state.of.res), fill="gray") +
  coord_flip() +
  theme(axis.text.y=element_text(size=rel(0.8)))

custdata = read.csv(url("http://www.millerjw.com/dom/mgmt490/rfile/data/WHO.csv"))

