开始使用免费开始使用

编辑 YAML 头部

YAML 头部包含报告的元数据,包括标题、作者和输出格式等信息。在本练习中,您将通过补充是谁创建了报告以及创建时间,来更新您的报告。

本练习是课程的一部分

使用 R Markdown 生成报告

查看课程

练习说明

  • 在标题下方为 YAML 头部添加 author 字段,并填写您的姓名。
  • 在作者信息下方添加 date 字段,并使用 Sys.Date() 函数。

交互式实操练习

通过完成这段示例代码来试试这个练习。

{"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## Datasets \n\n### Investment Annual Summary\n\nThe `investment_annual_summary` 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### Investment Services Projects\n\nThe `investment_services_projects` 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"}
编辑并运行代码