|
| 1 | +library(cairoDevice) |
| 2 | + |
1 | 3 | taxes <- read.csv("taxes.csv", header=TRUE)
|
2 | 4 |
|
3 |
| -chicago_tax <- taxes[taxes$tax_type == "CHMR",] |
| 5 | +chicago_rate = c(rep(.01, 24), rep(.0125, 28)) |
| 6 | + |
| 7 | +chicago_tax <- taxes[taxes$tax_type == "HMR",] |
| 8 | + |
| 9 | +chicago_total <- aggregate(chicago_tax$total, |
| 10 | + by=list(paste(chicago_tax$year, |
| 11 | + chicago_tax$quarter)), |
| 12 | + FUN=sum) |
| 13 | + |
| 14 | +chicago_total <- ts(chicago_total$x, c(1999,3), c(2012,2), 4) |
| 15 | +chicago_total <- chicago_total/chicago_rate |
| 16 | + |
| 17 | + |
| 18 | +png('sales.png') |
| 19 | +plot(chicago_total/1000000000, ylab="Dollars, billions", main="Taxable Sales in Chicago") |
| 20 | +dev.off() |
4 | 21 |
|
5 |
| -chicago_total <- ts(chicago_tax$total, c(1999,3), c(2012,2), 4) |
6 |
| -chicago_payers <- ts(chicago_tax$number_taxpayers, c(1999,3), c(2012,2), ) |
| 22 | +chicago_payers <- aggregate(chicago_tax$number_taxpayers, |
| 23 | + by=list(paste(chicago_tax$year, |
| 24 | + chicago_tax$quarter)), |
| 25 | + FUN=sum) |
7 | 26 |
|
8 |
| -plot(chicago_total/1000000, ylab="Dollars, millions", main="Chicago Home Rule Revenue by Quarter") |
| 27 | +chicago_payers <- ts(chicago_payers$x, c(1999,3), c(2012,2), 4) |
9 | 28 |
|
| 29 | +png('retailers.png') |
| 30 | +plot(chicago_payers, main="Retailers in Chicago") |
| 31 | +dev.off() |
0 commit comments