Created
June 1, 2020 01:08
-
-
Save TonyLadson/e984e820731e43b327902a3407da6f82 to your computer and use it in GitHub Desktop.
Code to draw the column graph in the blog at https://tonyladson.wordpress.com/2020/04/29/comments-on-the-report-impact-of-lower-inflows-on-state-shares-under-the-murray-darling-basin-agreement/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
issues <- tribble(~issue, ~pc, | |
'Inflows', 6, | |
'Demand changes', 6, | |
'System operation', 18, | |
'Equity of water sharing arrangements', 10, | |
'State entitlements and policies', 10, | |
'Environmental water', 11, | |
'Reliability of different licences', 4, | |
'Miscellaneous', 4, | |
'Lack of transparency and accountability', 7, | |
'Floodplain harvesting and the northern basin', 3, | |
'Basin plan', 6, | |
'Lower lakes', 7, | |
'Trade and ownership', 8) | |
issues %>% | |
summarise(sum(pc)) | |
p <- issues %>% | |
arrange(desc(pc)) %>% | |
ggplot(aes(x = as_factor(issue), y = pc)) + | |
geom_col(fill = 'blue', colour = 'black') + | |
guides(fill=FALSE) + | |
scale_y_continuous(name = 'Percentage of stakeholders raising issue') + | |
scale_x_discrete(name = '') + | |
theme_gray(base_size = 7) + | |
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) | |
p | |
ggsave(file.path('figures', 'issues_bar.png'), plot = p, width = 4, height = 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment