Taxation statistics 2015-16 Individuals: Number of individuals, by state/territory, postcode and taxable income range, 2015-16 income year
#initial load of dataset
str(table2)
## 'data.frame': 2567 obs. of 9 variables:
## $ State/ Territory1 : chr "ACT" "ACT" "ACT" "ACT" ...
## $ Postcode : chr "2600" "2601" "2602" "2603" ...
## $ a. $18,200 or less : num 685 730 2899 790 872 ...
## $ b. $18,201 to $37,000 : num 728 424 3314 848 912 ...
## $ c. $37,001 to $80,000 : num 1699 659 6563 1891 2360 ...
## $ d. $80,001 to $180,000: num 1789 696 5799 2031 2685 ...
## $ e. $180,000 or more : num 680 149 882 918 558 646 260 492 19 671 ...
## $ f. $80,001 or more : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Total : num 5581 2658 19457 6478 7387 ...
#fix some numeric columns
table2 <- IncomeRange2016%>%mutate(`d. $80,001 to $180,000`= as.numeric(IncomeRange2016$`d. $80,001 to $180,000`),
`e. $180,000 or more`= as.numeric(IncomeRange2016$`e. $180,000 or more`))
#remove last 2 columns
table2[8:9] <- NULL
#combine income groups from different columns, into 1 single column and a count column
tb2 <- table2 %>%
gather(`a. $18,200 or less`:`e. $180,000 or more`,
key = "Inc Group", value = "Inc Group Population")
Lets view Income Groups and number by State: