Skip to content

Commit

Permalink
adding pack small multiples plot lost during merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
drchriscole committed Oct 28, 2019
1 parent d104291 commit acf438d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
31 changes: 30 additions & 1 deletion DRD_in_Scotland_Visualisations.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
output:
html_document: default
pdf_document: default
html_document: default
---

```{r setup, include=FALSE}
Expand Down Expand Up @@ -450,6 +450,35 @@ ggplot(change.dat, aes(x=Region, y=Change, fill="#D55E00")) +

## Regional Comparisons

```{r tC1a, fig.height = 6}
## experiment with small multiples
# read data
table.dat = read_excel(xlfile, sheet = "C1 - summary", col_names=FALSE)
# extract core data and convert to numbers
dat = table.dat[10:41,1:12]
colnames(dat) = c('Council',seq(2008,2018,1))
dat$Council = c("Aberdeen", "Aberdeenshire", "Angus", "Argyll & Bute", "Edinburgh", "Clack'shire", "Dumfries & Ga.", "Dundee", "E. Ayrshire", "E. Dunb'shire", "E. Lothian", "E. Renf'shire", "Falkirk", "Fife", "Glasgow", "Highland", "Inverclyde", "Midlothian", "Moray", "Na h-Eil. Siar", "N. Ayrshire", "N. Lanarkshire", "Orkney Islands", "Perth & Kinross", "Renfrewshire", "Scot. Borders", "Shetland Islds", "South Ayrshire", "S. Lanarkshire", "Stirling", "W. Dunb'shire", "West Lothian")
dat.m = melt(dat)
ggplot(dat.m, aes(x=variable, y=value, group=Council, colour=ifelse(dat.m$Council == "Dundee", "A","B"))) +
ggtitle("Drug-Related Deaths by Council") +
xlab('Year') +
ylab('No. Deaths') +
geom_line(size=1.1) +
scale_x_discrete(breaks=c(2008, 2018), labels=c("'08","'18")) +
scale_colour_manual(values=c('orange','grey')) +
facet_wrap(~Council) +
theme_minimal() +
theme(legend.position = "none",
panel.grid.major.y = element_line(colour = 'lightgrey'),
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank())
```



```{r tC1, fig.width=7}
# read data
table.dat = read_excel(xlfile, sheet = "C1 - summary", col_names=FALSE)
Expand Down
1 change: 1 addition & 0 deletions DRD_in_Scotland_Visualisations.html

Large diffs are not rendered by default.

Binary file modified DRD_in_Scotland_Visualisations.pdf
Binary file not shown.

0 comments on commit acf438d

Please sign in to comment.