If you are not familiar with YAML, CSS, and some global options of RMarkdown formating, you can using the following steps to layout your assignments. 1. Open a new RMarkdown file 2. Choose "Document" and check HTML as the Default Output Format 3. Delete EVERYTHING in the window to make a blank document 4. Copy the following three blocks of code and paste them into the blank document 5. Save it into your designate location (folder) 6. Adjust the first three lines of YAML header: title, author, and date ============================ The following are three blocks of code to be copied =================== --- title: "An RMarkdown Template for Statistical Reports" author: "Your Name " date: "Date" output: pdf_document: toc: yes toc_depth: 4 fig_caption: yes number_sections: yes word_document: toc: yes toc_depth: 4 fig_caption: yes keep_md: yes html_document: toc: yes toc_depth: 4 toc_float: yes fig_width: 6 fig_caption: yes number_sections: yes theme: readable editor_options: chunk_output_type: console --- ```{=html} ``` ```{r setup, include=FALSE} # Detect, install, and load packages if needed. if (!require("knitr")) { install.packages("knitr") library(knitr) } if (!require("leaflet")) { install.packages("leaflet") library(leaflet) } if (!require("EnvStats")) { install.packages("EnvStats") library(EnvStats) } if (!require("MASS")) { install.packages("MASS") library(MASS) } if (!require("phytools")) { install.packages("phytools") library(phytools) } # # Specifications of outputs of code in code chunks knitr::opts_chunk$set(echo = FALSE, # include code chunk in the output file warning = FALSE, # Sometimes, your code may produce a warning # messages, you can choose to include the # warning messages in the output file. message = FALSE, results = TRUE, # you can also decide whether to include # the output in the output file. comment = FALSE # Suppress hash-tags in the output results. ) ```