為文件建立結構
接下來,你將用上一章產生的圖,建立一份逐步說明的 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"}