为文档搭好结构
接下来,您将基于上一章的可视化,创建一份分步骤的 RMarkdown 报告。第一步是通过章节标题来搭建结构。
PS:请注意,较好的做法是在标题符号与标题文本之间"留一个空格"!这样可以让您的 Markdown 语法更清晰、易读。
本练习是课程的一部分
在 Tidyverse 中用数据进行沟通
练习说明
- 将这些段落的章节名(例如 "Summary")用合适的 RMarkdown 语法改为标题。
- "Summary"、"Preparations" 和 "Analysis" 应为二级标题,而 "Data"、"Preprocessing" 和 "Results" 应为三级标题。
请记得遵循上面的最佳实践,在标题符号后包含一个空格!
交互式实操练习
通过完成这段示例代码来试试这个练习。
{"my_document.Rmd":"---\ntitle: \"The reduction in weekly working hours in Europe\" \nsubtitle: \"Looking at the development between 1996 and 2006\"\nauthor: \"Insert your name here\"\noutput: html_document\n---\n\nSummary\n\nThis is where you are going to quickly summarize what you did.\n\nPreparations\n\nThis is where you will load the necessary R packages.\n\nAnalysis\n\nData\n\nThis is where you will load the data. \n\nPreprocessing\n\nThis is where you will preprocess the data.\n\nResults\n\nThis is where you will plot the data.\n\n\n"}