Skip to content

Compile the R Tutorial

Vaggelis Kapartzianis edited this page Dec 14, 2016 · 1 revision

Render the tutorial document as HTML

Before proceeding, make sure you have set up your working environment as detailed in Getting Started.

  1. Locate the source document in the "Files" pane. It's an R markdown document, Rtutorial.Rmd in CourseSessions/Rtutorial.

    image
    image

  2. Click "Knit" in the editor pane.

    image

    You'll be prompted to set up additional R packages, to support Rmd compilation. Accept their installation.

    image

  3. RStudio will render the document as a web page and display it in a separate window.

    image

  4. The compiled document, is a standalone HTML page, in the same folder as its source. You can open it in a web browser to verify a successful compilation.

    image


## Render the tutorial document as PDF (optional)

Note: LaTeX is required to render the tutorial document in PDF format. Refer to the LaTeX Project's Getting LaTeX guide for further details. MiKTeX is recommended for Windows, MacTeX is your only option on OSX.

  1. Select "Knit to PDF" from the "Knit" dropdown menu in the editor pane.

    image

  2. RStudio will render the document and, after a short while, display it in a separate window.

    image

  3. During compilation, our source document was modified to set PDF as the default output format, and a PDF file now resides in the source folder. We don't want to commit those changes so, in the "Git" pane, select "Revert..." after right clicking on Rtutorial.Rmd

    image
    then select "Ignore" on the context menu for Rtutorial.pdf

    image

  4. The compiled document is still available, in the same folder as its source. You can open it in your default PDF viewer to verify a successful compilation.

    image

Clone this wiki locally