Commits

Casey Dunn committed 4c957d8

initiailized repository from code for Chile talk

  • Participants

Comments (0)

Files changed (3)

+# A simple executable paper example
+
+Ask the audience to provide some guesses at how many people died on the Titanic, and fill 
+these numbers in for the `guesses` vector in `mymanuscript.rmd`.
+
+Then, to build this paper, simply type:
+
+    ./knit mymanuscript.rmd
+
+Requires at least:
+
+- (R)[http://www.r-project.org/] version 3.0.1
+- (knitr)[http://yihui.name/knitr/] version 1.2 
+- (pandoc)[http://johnmacfarlane.net/pandoc/] version 1.11.1
+#!/bin/bash
+
+FULLFILE=$1
+
+#FILENAME=$(basename "$FULLFILE")
+#extension="${filename##*.}"
+FILENAME="${FULLFILE%.*}"
+
+echo $FILENAME
+
+Rscript -e "require(knitr); require(markdown); knit('$FULLFILE', '$FILENAME.md')"
+
+pandoc $FILENAME.md -o $FILENAME.pdf
+
+open $FILENAME.pdf
+
+
+
+# Popular understanding of the Titanic catastrophe
+
+## Introduction
+
+Everyone knows that the Titanic sank, but there is generally little sense of the magnitude 
+of the disaster. Here I compare some guesses of the total number of passengers that died 
+to actual mortality statistics.
+
+
+## Results
+
+The vector representation of guesses at the total number of passengers that died is:
+
+
+```{r}
+guesses <- c(1,1,1)
+
+```
+
+
+I polled a total of `r length(guesses)` people. Their mean guess was `r mean(guesses)`. 
+
+The actual number of deaths can be extracted from the Titanic R sample dataset as follows:
+
+```{r}
+actual <- apply(Titanic, c(4), sum)['No']
+
+```
+Giving a total of `r actual` deaths.
+
+Here is a plot of the guesses versus the actual value:
+
+```{r}
+hist(guesses)
+abline(v=actual,col=3,lty=3)
+
+```
+
+
+## Discussion
+
+
+This subject clearly requires further study. 
+
+
+