開始使用免費開始

在報告中加入章節

先前你已經把將用來建立報告的資料集名稱,加入到會用來產生報告的 Markdown 檔。現在,你要在文件中加入一些標題和文字,讓將閱讀這份報告的讀者能更了解這些資料集。

本練習屬於課程

使用 R Markdown 製作報告

檢視課程

練習說明

  • 在報告的第 14 行加入名為 Datasets 的標題,使用兩個井字。
  • 在報告的第 16 與第 23 行加入標題,以三個井字分別標示各資料集名稱:Investment Annual Summary 與 Investment Services Projects。
  • 將資料集名稱加入報告第 18 與第 25 行的句子中,並將它們格式化為行內程式碼。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

{"investment_report.Rmd":"---\ntitle: \"Investment Report\"\noutput: html_document\n---\n\n```{r data, include = FALSE}\nlibrary(readr)\n\ninvestment_annual_summary <- read_csv(\"https://assets.datacamp.com/production/repositories/5756/datasets/d0251f26117bbcf0ea96ac276555b9003f4f7372/investment_annual_summary.csv\")\ninvestment_services_projects <- read_csv(\"https://assets.datacamp.com/production/repositories/5756/datasets/78b002735b6f620df7f2767e63b76aaca317bf8d/investment_services_projects.csv\")\n```\n\n\n\n\n\n\nThe ___ dataset provides a summary of the dollars in millions provided to each region for each fiscal year, from 2012 to 2018.\n```{r}\ninvestment_annual_summary\n```\n\n\n\nThe ___ dataset provides information about each investment project from the 2012 to 2018 fiscal years. Information listed includes the project name, company name, sector, project status, and investment amounts.\n```{r}\ninvestment_services_projects \n```\n\n\n"}
編輯並執行程式碼