On January 21th at 14:15 UTC , progression through exercises will be unavailable for 10 minutes due to a planned maintenance break.
Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Reading from a file
2. Reading a CSV file
Reading from an Excel file


Let's suppose that we work for a mining company and part of our job is to prepare reports. The data comes in a variety of file formats.

The first format we'll work with is CSV. CSV files store tabular data as plain text. CSV stands for comma-separated values because each subsequent value in a CSV file is usually separated from the previous one by a comma. Here's an example of a CSV file:


Let's review how to load a CSV file using the read.csv() command. If we want to load the file data/Goldworth_Mines.csv, we write:


Eventually, we'll get the following data frame:

first_name last_name monthly_production
1 Ellen Blanque 282
2 Anica Symons 230
3 Chaim Robertelli 308


Load the Echo Depths Mines' report (from the data/echo_depths_mines.csv file) and assign it to the echo_depths_mines variable. Use the read.csv() function.