Reproducibility 2 R Markdown Workshop 4 2 Aim In this session - - PowerPoint PPT Presentation

reproducibility 2 r markdown
SMART_READER_LITE
LIVE PREVIEW

Reproducibility 2 R Markdown Workshop 4 2 Aim In this session - - PowerPoint PPT Presentation

1 Reproducibility 2 R Markdown Workshop 4 2 Aim In this session learn how to create fully reproducible outputs in a variety of formats using R Markdown Objectives By following the slides and applying the techniques to examples the


slide-1
SLIDE 1

1

Reproducibility 2 R Markdown

Workshop 4

slide-2
SLIDE 2

2

Aim

In this session learn how to create fully reproducible outputs in a variety of formats using R Markdown

Objectives

By following the slides and applying the techniques to examples the successful student will be able to:

  • use r markdown to format a document
  • be able to select code chunk options to control whether code runs and

appears, and output is displayed

  • use inline coding to display output with text elements
  • use formatting including tables, headers, lists, special characters
  • produce reproducible reports and evaluate their success in doing so
slide-3
SLIDE 3

3

Reproducibility continuum

Organise your files Script everything Organisation and Comments Code: formatting and style Code: ‘algorithmically’ / ‘algebraically’ Use RStudio, R Markdown, knitr Collaboration and Version control: Git and GitHub Public repositories of protocols, raw data, and source code Increasing reproducibility

Required here

slide-4
SLIDE 4

4

Reproducibility: Script everything

R Markdown The ‘lab book’, the analysis and code, and the report all in one document. Can work on the analysis and the report simultaneously. Can determine what code runs, what output appears Can output in different formats

slide-5
SLIDE 5

5

Reproducibility: Use RStudio, R Markdown, knitr

knitr “Elegant, flexible and fast dynamic report generation with R” enables integration of R code into Markdown, LaTeX and HTML R Markdown “R Markdown documents are fully reproducible. Use a productive notebook interface to weave together narrative text and code to produce elegantly formatted output.”

slide-6
SLIDE 6

6

R Markdown - under the hood

markdown files: Have an .Rmd extension Contain plain text and R code chunks. knitr: executes all of the R code chunks and creates a new markdown (.md) document of the R code and it’s output Pandoc processes the .md file to html, PDF, MS Word document, etc etc

slide-7
SLIDE 7

7

R Markdown

Simpler than it seems: [Install rmarkdown] Open a new R markdown document Write document - simple formatting is very easy, fancy formatting is easy Knit the document demo

slide-8
SLIDE 8

8

R Markdown

R Markdown supports dozens of static and dynamic output formats including: HTML PDF MS Word Beamer HTML5 slides Tufte-style handouts Books (bookdown) Shiny applications scientific articles Websites, and more (blogdown)