4 Week 4 : R markdown
4.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
4.2 Wonderful resources for R markdown
R Markdown: The Definite Guide (the most comprehensive resource)
4.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
4.4 Publish your R markdown Documents
- You can easily publish your R markdown documents