เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Adding code chunks to your file

When creating your own reports, one of the first things you'll want to do is add some code! In the video, we discussed how you can add your own code by adding code chunks. Previously, we looked at the investment_annual_summary dataset we'll be using throughout the course. In this exercise, let's take a look at the annual summary dataset as well as the other dataset we'll be using, investment_services_projects.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Reporting with R Markdown

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Add a new code chunk to the Markdown file, starting at line 14.
  • Within the code chunk, type the names of the investment_annual_summary and investment_services_projects datasets to print them in the report.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

{"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"}
แก้ไขและรันโค้ด