Creating your first R Markdown file
Throughout the course, you'll be working on creating an investment report using two datasets from the World Bank IFC. The first dataset, investment_annual_summary
, provides the summary of the dollars in millions provided to each region for each fiscal year, from 2012 to 2018. To get started on your report, you first want to print out the dataset.
To create your report, you'll need to edit the Markdown file shown on the right as described in the instructions, then press the green "Knit HTML" button to knit the file and see the resulting HTML file. We'll discuss other output types later in the course.
In each exercise, the first code chunk in the Markdown file will load the readr
package and the datasets you'll be using in the exercise. You'll learn more about the details of this code chunk later in the course, but you won't need to modify it for any of the exercises in this chapter.
This exercise is part of the course
Reporting with R Markdown
Exercise instructions
- Add the
investment_annual_summary
dataset to the code chunk in your report.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
{"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\")\n```\n\n```{r}\n___\n```\n\n\n"}