-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Compile the R Tutorial
Before proceeding, make sure you have set up your working environment as detailed in Getting Started.
-
Locate the source document in the "Files" pane. It's an R markdown document,
Rtutorial.Rmd
inCourseSessions/Rtutorial
.
-
Click "Knit" in the editor pane.
You'll be prompted to set up additional R packages, to support Rmd compilation. Accept their installation.
-
RStudio will render the document as a web page and display it in a separate window.
-
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.
## 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.
-
Select "Knit to PDF" from the "Knit" dropdown menu in the editor pane.
-
RStudio will render the document and, after a short while, display it in a separate window.
-
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
then select "Ignore" on the context menu forRtutorial.pdf
-
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.