Chapter 2 R markdown (Week 2)
2.1 What is R markdown documents?
An R markdown document (a file with the extension
.Rmd
) allows us to create a report in a variety of formats (e.g., html, pdf, word, slides, interactive documents) that includes your codes, results, and texts.An R markdown document is a plain text file with special formatting characters (i.e., Pandoc’s Markdown).
When you render an R markdown document using the
render()
function,
- An R markdown document has the following structure:
- YAML header
- YAML includes options for rendering
- YAML is surrounded by - - -
- YAML stands for “YAML Ain’t Markup Language”
- Text
- Text includes narration formatted with markdown
- Code chunks
- Code chunks include R Codes
- Code chunks are surrounded by ```
- YAML header
2.2 Wonderful resources for R markdown
R Markdown: The Definite Guide (the most comprehensive resource)
2.3 RStudio Projects
- RStudio Projects allows us
- to keep all files relevant to a project together
- to get back to where we left
- Ch8. Workflow: projects in R for data science
2.4 Publish your R markdown Documents
- You can easily publish your R markdown documents
2.5 Homework 2
The goal of this HW2 is to check whether you can publish your contents using bookdown. In this way, you can communicate your findings with others. Please note that the ability to communicate with others is one of our learning objective. So create a bookdown on the bookdown.org following the instructions in the lecture video and below, and send the URL (or link) of your published bookdown to intro.r.ewha@gmail.com by the 11:59pm on Mar 17 (Next Wed) with the email title “[HW2] your name here”.
For HW2, do the following:
- Following the instructions in the lecture video, create an a template bookdown and publish it on your own bookdown account.
- Include the Code chunk 1, 2, 3, and 4 for HW1 in the first page of your bookdown website.
- Include your name at the top of the first page.
- Send the link to your bookdown website to to intro.r.ewha@gmail.com by the 11:59pm on Mar 17 (Next Wed) with the email title “[HW2] your name here”. (e.g., [HW2] Sunbok Lee)