This week, we revisit creating and maintaining online notebooks using RMarkdown. Two weeks ago, we worked with plain Markdown to create an example notebook. The process with RMarkdown is largely similar, but this format offers greater functionality and less typing.
We will be using RStudio to create a RMarkdown document. But before we can do so, we will need to install following software:
RMarkdowninstall.packages("rmarkdown")library(devtools)
devtools::install_github("rstudio/rmarkdown")TinyTeXRMarkdown is able to produce LaTeX formatted output (.tex format) but it requires TinyTeX a very small and easy to maintain TeX distribution. Installation is straightforward:
install.packages("tinytex")
library(tinytex)
tinytex::install_tinytex()This exercise uses a population genomic data set from study of two hybridizing Populus species. One of the goals of this study was to uncover signatures of natural selection (sensu Darwin) in hybrid individuals. In order to do this, a genetic differentiation index called Fst is calculated between populations for two sets of genetic loci: those that have been determined to be under the effect of natural selection and those that are presumed neutral (i.e. no selection). We will be making a couple of figures from this data.
sig.fst contains data for SNPs under natural selection
neu.fst contains data for SNPs presumed neutral
pval_counts.txt contains data on bootstrapping
R Markdown: A Definitive Guide by Yihui Xie, J. J. Allaire, Garrett Grolemund