Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Reading from a file
5. Header option
Reading from an Excel file
Summary

Instruction

Oops. Something went wrong. We have column names in the first row, which isn't what we want.

To fix this, we must add the header argument to the read.table() function. It tells R that the first line of the file contains a header – names for the columns. To do this, we will write:

df_report_thunderrock <- read.table("data/thunderrock_industries.csv", sep = ";", header = TRUE)

Note: In read.csv() and read.delim(), this option is set to TRUE by default.

Exercise

Load the Iron Mountain Mineshaft report into memory. Use the data/iron_mountain_mineshaft.csv file with the read.table() function. Set the separator as ";" and set the header option to TRUE. Assign it to the iron_mountain_mineshaft variable.