Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Readr
Summary

Instruction

Interesting, isn't it? It seems that our botanical garden's employee saved the date when he created the data and then put a line of = to separate it from data. It sometimes happens that the first few rows of a file have additional information about the data (like here) from the person who created the file. This information is irrelevant to us and is actually causing some issues.

What can we do? Do we need to change data? We could change it, but that is not a good practice. Instead, we will use another read_csv() argument: skip. As you might guess, this lets us skip a stated number of lines when reading a file. If we wanted to skip the first five lines in our Winter University CSV file, we'd write:

read_csv("data/winters_students.csv", skip = 5)

Exercise

Read data/plants.csv, skip the first two lines, and assign the rest of the data to the plants variable. Is everything okay now?

Stuck? Here's a hint!

Type:

plants <- read_csv("data/plants.csv", skip = 2)