开始使用免费开始使用

为报告添加章节

此前,您已经把将用于构建报告的数据集名称添加到了用于生成报告的 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"}
编辑并运行代码