updates to yaml and added notes for plots

This commit is contained in:
Jeremy Kidwell 2019-01-26 11:09:06 +00:00
parent 0f8c847fca
commit 76a9b1dab2
2 changed files with 22 additions and 4 deletions

View file

@ -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.
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:
- Karl Broman's guide, "[Initial Steps Toward Reproducible Research](http://kbroman.org/steps2rr/)"

View file

@ -11,8 +11,18 @@ bibliography: /Users/jeremy/Dropbox/bibtex/everything.bib
linkcolor: black
fontsize: 12pt
output:
pdf_document:
keep_tex: true
html_document:
keep_md: true
toc: true
toc_depth: 2
number_sections: true
fig_caption: true
pdf_document:
keep_tex: true
number_sections: true
fig_caption: true
citation_package: natbib
latex_engine: xelatex
---
```{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
# 3. Need to clip choropleth polygons to buildings shapefile
# tidy data
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))
# plot as
ggsave("figures/admin_choropleth_ecs.pdf")
```
@ -324,6 +339,8 @@ ggplot(admin.df_gathered, aes(fill=group_type, y=number, x=name)) +
# ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) +
geom_bar() +
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/
```
@ -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]
# plot as chlorogram: https://www.r-graph-gallery.com/331-basic-cartogram/
# Appendix A
```{r pander_admin_table}