mirror of
https://github.com/kidwellj/mapping_environmental_action.git
synced 2025-01-10 07:42:20 +00:00
updates to yaml and added notes for plots
This commit is contained in:
parent
0f8c847fca
commit
76a9b1dab2
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
If you're new to github and reproducible research, welcome! It's nice to have you here. Github is ordinarily a place where software developers working on open source software projects deposit their code as they write software collaboratively. However, in recent years a number of scholarly researchers, especially people working on research which involves a digital component (including me!) have begun to deposit their papers in these same software repositories. The idea here is that you can download all of the source-code and data used in this paper alongside the actual text, run it yourself and ["reproduce" the results](http://kbroman.org/steps2rr/). This can serve as a useful safeguard, a layer of research transparency, and a cool teaching tool for other persons interested in doing similar work.
|
If you're new to github and reproducible research, welcome! It's nice to have you here. Github is ordinarily a place where software developers working on open source software projects deposit their code as they write software collaboratively. However, in recent years a number of scholarly researchers, especially people working on research which involves a digital component (including me!) have begun to deposit their papers in these same software repositories. The idea here is that you can download all of the source-code and data used in this paper alongside the actual text, run it yourself and ["reproduce" the results](http://kbroman.org/steps2rr/). This can serve as a useful safeguard, a layer of research transparency, and a cool teaching tool for other persons interested in doing similar work.
|
||||||
|
|
||||||
Eschewing proprietary, expensive and unreliable software like Microsoft Word, I write in a combination of two languages: (1) [Markdown](https://en.wikipedia.org/wiki/Markdown) which is intended to be as close as possible to plain text while still allowing for things like boldfaced type, headings and footnotes; and (2) a programming language called [R](https://en.wikipedia.org/wiki/R_(programming_language)) to do all the data analysis. R is an object oriented language which was specifically designed for statistical analysis. It's also great fun to tinker with. As you look through this paper, you'll see that R code is integrated into the text of the document. This is indicated by a series of three backticks (```).
|
Eschewing proprietary, expensive and unreliable software like Microsoft Word, I write in a combination of two languages: (1) [Markdown](https://en.wikipedia.org/wiki/Markdown) which is intended to be as close as possible to plain text while still allowing for things like boldfaced type, headings and footnotes; and (2) a programming language called [R](https://en.wikipedia.org/wiki/R_(programming_language)) to do all the data analysis. R is an object oriented language which was specifically designed for statistical analysis. It's also great fun to tinker with. As you look through this paper, you'll see that R code is integrated into the text of the document. This is indicated by a series of three backticks (```). There is a formal specification now at a mature stage of development, which is RMarkdown. You can read semi-official specification [for this here](https://bookdown.org/yihui/rmarkdown/pdf-document.html).
|
||||||
|
|
||||||
To read a bit more on these things and start on your own path towards plain text reproducible research, I highly recommend:
|
To read a bit more on these things and start on your own path towards plain text reproducible research, I highly recommend:
|
||||||
- Karl Broman's guide, "[Initial Steps Toward Reproducible Research](http://kbroman.org/steps2rr/)"
|
- Karl Broman's guide, "[Initial Steps Toward Reproducible Research](http://kbroman.org/steps2rr/)"
|
||||||
|
|
|
@ -11,8 +11,18 @@ bibliography: /Users/jeremy/Dropbox/bibtex/everything.bib
|
||||||
linkcolor: black
|
linkcolor: black
|
||||||
fontsize: 12pt
|
fontsize: 12pt
|
||||||
output:
|
output:
|
||||||
|
html_document:
|
||||||
|
keep_md: true
|
||||||
|
toc: true
|
||||||
|
toc_depth: 2
|
||||||
|
number_sections: true
|
||||||
|
fig_caption: true
|
||||||
pdf_document:
|
pdf_document:
|
||||||
keep_tex: true
|
keep_tex: true
|
||||||
|
number_sections: true
|
||||||
|
fig_caption: true
|
||||||
|
citation_package: natbib
|
||||||
|
latex_engine: xelatex
|
||||||
---
|
---
|
||||||
|
|
||||||
```{r setup, include=FALSE}
|
```{r setup, include=FALSE}
|
||||||
|
@ -283,10 +293,15 @@ Perhaps the first important question to ask of these groups is, where are they?
|
||||||
# Row 1 plot using polygons from admin_lev1 and row 2 plot using ploygons from admin_lev2
|
# Row 1 plot using polygons from admin_lev1 and row 2 plot using ploygons from admin_lev2
|
||||||
# 3. Need to clip choropleth polygons to buildings shapefile
|
# 3. Need to clip choropleth polygons to buildings shapefile
|
||||||
|
|
||||||
|
# tidy data
|
||||||
admin_lev1_gathered <- gather(admin_lev1_sf, value="number", ecs_count)
|
admin_lev1_gathered <- gather(admin_lev1_sf, value="number", ecs_count)
|
||||||
|
|
||||||
|
# plot simple choropleth, as here: https://www.r-graph-gallery.com/327-chloropleth-map-from-geojson-with-ggplot2/
|
||||||
|
|
||||||
myplot <- ggplot() + geom_sf(data = admin_lev1_gathered) + geom_point(data=as.data.frame(ecs), aes(x=X, y=Y))
|
myplot <- ggplot() + geom_sf(data = admin_lev1_gathered) + geom_point(data=as.data.frame(ecs), aes(x=X, y=Y))
|
||||||
|
|
||||||
|
# plot as
|
||||||
|
|
||||||
ggsave("figures/admin_choropleth_ecs.pdf")
|
ggsave("figures/admin_choropleth_ecs.pdf")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -325,6 +340,8 @@ ggplot(admin.df_gathered, aes(fill=group_type, y=number, x=name)) +
|
||||||
geom_bar() +
|
geom_bar() +
|
||||||
coord_flip()
|
coord_flip()
|
||||||
|
|
||||||
|
# add bubbleplot on map, as here: https://www.r-graph-gallery.com/330-bubble-map-with-ggplot2/ or here: https://www.r-graph-gallery.com/177-map-with-proportional-symbols/
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
We can compare the representation in these various regions against our comparison groups to see how other community-based organisations cluster in Scottish administrative districts. Here there are some significant contrasts. Scottish Community Development trusts are most intensely concentrated in the Highlands and Argyll & Bute. But, this is consistent with all the other categories, Eco-Congregations, Places of Worship, and dtass are all over-represented in this area, varying only by the degree. Edinburgh is different, here we find that Eco-Congregations and Transition projects are over-represented, while dtass are under-represented. Finally, the highlands are another strong contrast, here we find a very strong over-representation by transition towns and dtass while the representation of Eco-Congregations is relatively close to the population share for that area. The two areas of greatest contrast for Eco-Congregations from the other groups are unsurprising, Edinburgh is the location of the ECS offices, while Stirling is the area in which ECS first began (see Appendix B for full data).
|
We can compare the representation in these various regions against our comparison groups to see how other community-based organisations cluster in Scottish administrative districts. Here there are some significant contrasts. Scottish Community Development trusts are most intensely concentrated in the Highlands and Argyll & Bute. But, this is consistent with all the other categories, Eco-Congregations, Places of Worship, and dtass are all over-represented in this area, varying only by the degree. Edinburgh is different, here we find that Eco-Congregations and Transition projects are over-represented, while dtass are under-represented. Finally, the highlands are another strong contrast, here we find a very strong over-representation by transition towns and dtass while the representation of Eco-Congregations is relatively close to the population share for that area. The two areas of greatest contrast for Eco-Congregations from the other groups are unsurprising, Edinburgh is the location of the ECS offices, while Stirling is the area in which ECS first began (see Appendix B for full data).
|
||||||
|
@ -335,6 +352,7 @@ We can compare the representation in these various regions against our compariso
|
||||||
|
|
||||||
[Figure 4, normalised by PointX data; also including agricultural parishes etc. as above]
|
[Figure 4, normalised by PointX data; also including agricultural parishes etc. as above]
|
||||||
|
|
||||||
|
# plot as chlorogram: https://www.r-graph-gallery.com/331-basic-cartogram/
|
||||||
# Appendix A
|
# Appendix A
|
||||||
|
|
||||||
```{r pander_admin_table}
|
```{r pander_admin_table}
|
||||||
|
|
Loading…
Reference in a new issue