reporting reproducible research with r and markdown
play

Reporting Reproducible Research with R and Markdown Garrick - PowerPoint PPT Presentation

Reporting Reproducible Research with R and Markdown Garrick Aden-Buie // April 11, 2014 INFORMS Code & Data Boot Camp Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 1 / 46 Lots of things to install


  1. Reporting Reproducible Research with R and Markdown Garrick Aden-Buie // April 11, 2014 INFORMS Code & Data Boot Camp Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 1 / 46

  2. Lots of things to install Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 2 / 46 http://www.tug.org/mactex/morepackages.html � LaTeX � Mac: BasicTeX � Windows: MiKTeX http://miktex.org/ � Linux: apt-get install texlive � pandoc � http://johnmacfarlane.net/pandoc � R � http://r-project.org � http://rstudio.com � knitr � http://yihui.name/knitr/ � Go all out: git � http://git-scm.org

  3. Garrick Aden-Buie // April 11, 2014 Skip the talk, learn at home Reporting Reproducible Research with R and Markdown 3 / 46 � pandoc user guide � http://johnmacfarlane.net/pandoc/README.html � knitr user guide � http://yihui.name/knitr/ � http://kbroman.github.io/knitr_knutshell/ � git � https://bitbucket.org/gadenbuie/intro-to-git-for-scientists

  4. Garrick Aden-Buie // April 11, 2014 Today we’ll talk about Reporting Reproducible Research with R and Markdown 4 / 46 � What’s the deal with Reproducible Research? � What’s up with Markdown? � A complete research flow � A simple example � Show and tell

  5. Reproducible research What’s the deal with Reproducible Research? …is the idea that data analyses, and more generally, scientific claims, are published with their data and software code so that others may verify the findings and build upon them. Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 5 / 46 � Kind of a hot topic these days � Coursera’s course � PLoS One Data Policy � RunMyCode � Code & Data are as much a part of research output as pubs

  6. Write once, output to anything Make collaboration easier 1 and more scalable Why should you care? Start to finish, integrate everything 1 YMMV Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 6 / 46 � Version Control and Management!

  7. Make collaboration easier 1 and more scalable Why should you care? Write once, output to anything 1 YMMV Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 7 / 46 � Version Control and Management! � Start to finish, integrate everything

  8. Make collaboration easier 1 and more scalable Why should you care? 1 YMMV Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 8 / 46 � Version Control and Management! � Start to finish, integrate everything � Write once, output to anything

  9. Why should you care? 1 YMMV Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 9 / 46 � Version Control and Management! � Start to finish, integrate everything � Write once, output to anything � Make collaboration easier 1 and more scalable

  10. Which reminds me… Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 10 / 46

  11. A complete research flow Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 11 / 46

  12. The core workflow Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 12 / 46

  13. The full workflow Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 13 / 46

  14. Mendeley Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 14 / 46

  15. Set up Mendeley + BibTeX Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 15 / 46

  16. Where to find the citekey Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 16 / 46

  17. BibTeX entry of Stations of a Mixed Fleet Biking System: An Application Reporting Reproducible Research with R and Markdown Garrick Aden-Buie // April 11, 2014 } year = {2012} volume = {54}, url = {http://www.sciencedirect.com/science/article/pii/S1877042812042310}, to the City of Lisbon}}, title = {{An Optimisation Algorithm to Establish the Location ~/Dropbox/USF/Resources/BibTeX/library.bib pages = {513--524}, month = oct, journal = {Procedia - Social and Behavioral Sciences}, issn = {18770428}, doi = {10.1016/j.sbspro.2012.09.769}, author = {Martinez, Luis M. and Caetano, Luis}, @article{Martinez2012, 17 / 46

  18. What’s up with Markdown? Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 18 / 46

  19. What is markdown? Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 19 / 46 � The ctrl+B of plain text � Many variants, modern markdown father: � https://daringfireball.net/projects/markdown/ � Lots of variants, but same idea: plain-text readable markup � MultiMarkdown � Github-flavored markdown � ReST � TeX � pandoc has it’s own special features � General concept: think like HTML or Word “styles”

  20. Markdown crash course Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 20 / 46

  21. Let’s walk through an example together http://bit.ly/1qIyQbv 2 2 http://www.unexpected-vortices.com/sw/gouda/quick-markdown- example.html Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 21 / 46

  22. Title Pandoc allows special syntax on the first three lines for document metadata. % Title % Author % 2014-04-11 Or YAML metadata blocks. Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 22 / 46

  23. Headers Two ways to make headers, think <h1> , <h2> , … levels. An h1 header ============ An h2 header ------------ # Also h1 header ## Also h2 header Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 23 / 46

  24. Paragraphs Paragraphs are separated by a blank line. I like starting new sentences on a new line. It’s odd, I know. Paragraphs are separated by a blank line. I like starting new sentences on a new line. It’s odd, I know. Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 24 / 46

  25. Formatting Formatting is easy: *italics*, **bold**, ‘monospace‘, ~~strikethrough~~. Also H~2~O and Na^+^. Formatting is easy: italics , bold , monospace , strikethrough. Also H 2 O and Na + . Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 25 / 46

  26. Lists - Item 1 1. Sub item 1 Still sub item 1 - Item 2 1. Sub item 1 Still sub item 1 Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 26 / 46 � Item 1 � Item 2

  27. Block quotes > Block quotes are > written like so. > > They can span multiple paragraphs, > if you like. Block quotes are written like so. They can span multiple paragraphs, if you like. Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 27 / 46

  28. Code Sample Code samples start with three ‘ characters or three ~ or are indented 4 spaces, and can include the code style. ‘‘‘r hist(rnorm(100)) ‘‘‘ Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 28 / 46

  29. Tables size Reporting Reproducible Research with R and Markdown Garrick Aden-Buie // April 11, 2014 transparent glass 11 natural hemp canvas 10 brown leather 9 color material transparent Tables can look like this: glass 11 natural hemp canvas 10 brown leather 9 ------------ ------------ ---- color material size 29 / 46

  30. Tables 2 10 Table: This table has a caption. size material color 9 leather brown hemp canvas | natural 11 glass transparent Table 2: This table has a caption. Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown transparent | glass Or they can also look like this: leather |size | material | color | |:----|:------------:|--------------:| | 9 | | | brown | | 10 | hemp canvas | natural | | 11 30 / 46

  31. Links There are a [couple] of ways to [make][foo] a [link](http://bing.com). <http://garrickadenbuie.com> [couple]: http://google.com [foo]: http://xkcd.com There are a couple of ways to make a link. http://garrickadenbuie.com Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 31 / 46

  32. Footnotes Footnotes are very similar to links[^disclaimer]. [^disclaimer]: Don’t believe everything this guy says. Footnotes are very similar to links 3 . 3 Don’t believe everything this guy says. Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 32 / 46

  33. LaTeX Math Inline math equations go in like so: $\omega = d\phi / dt$. Display math should get its own line and be put in in double-dollar signs: $$I = \int \rho R^{2} dV$$ should get its own line and be put in in double-dollarsigns: Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 33 / 46 Inline math equations go in like so: ω = d φ / dt . Display math ∫ ρ R 2 dV I =

  34. pandoc Garrick Aden-Buie // April 11, 2014 Reporting Reproducible Research with R and Markdown 34 / 46

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend