Integrates into a single window:
- R console (CLI)
- text editor
- file/environment/history/help browser(s)
- graphic viewer
Makes it easy to dive into R!
What is R Markdown?
- Plain text formatting syntax (markup language)
- Originally designed for creating web documents
- Easy-to-read and easy-to-write
- Allows you to focus on content, rather than layout
- Can be converted into virtually any format, e.g.
.pdf
,.html
,.doc
- Issues:
You need a LaTeX program (we will use MikTex)
MikTex needs to be installed for all users (this is not the default)
MiKTeX needs privileges to install packages on-the-fly (also, not the default)
- Procedures:
-
Go to MiKTex website and click Download
-
Click on the downloaded file to install
-
Accept the MikTeX copying conditions and click Next
-
Change Installation Scope to Install MiKTeX for anyone who uses this computer
-
Installation directory can stay to same ... click Next
-
Settings options: Preferred Paper: 90% of the world uses A4 but the United States uses Letter
-
Install missing packages on-the-fly: switch to Yes
-
Click Next
-
Review: click Start
Note: the first time you use execute RMarkDown Knit-to-PDF will take a LOOOONG time because MiKTeX is downloading many missing packages
The easiest way is to download MacTex here:
… click on MacTex Download
MacTex is straightforward – just download and install using all defaults. But MacTex is over 4GB – the network would throw a bit of a fit if everyone in the class was downloading this at the same time.
Note: The smaller LaTeX software linked on the page, BasicTeX, does not work with RMarkDown.
I tested this on Mac 10.12 (Sierra) and Mac 10.14 (Mojave).
Mac 10.15 (Catalina) is being released this September. Students should avoid upgrading to Catalina because setups like what this class demands are notorious for not working right on the first iteration of a new Mac OS.
- Using R Markdown for Class Reports by Cosma Shalizi
- Markdown Basics, which describes the most commonly used markdown constructs.
- R Code Chunks, which goes into more depth on customizing the behavior of embedded R code.
- R Markdown Cheat Sheet (PDF), a quick guide to the most commonly used markdown syntax, knitr options, and output formats.
- R Markdown Reference Guide (PDF), a more comprehensive reference guide to markdown, knitr, and output format
- Compiling Notebooks, which describes how to compile HTML, PDF, or MS Word notebooks from R scripts. Document output formats: HTML, PDF, Word
- Having installed R and RStudio before installing MikTeX?
- Note: TinyTex is a custom LaTeX distribution based on TeX Live that is small in size but functions well in most cases, especially for
R
users. TinyTex is easier to install than MikTex and works well with Rstudio. More detail about TinyTex can be found in: https://yihui.name/tinytex/