Readr
Summary

Instruction

It seems like the first row of data was used for the column names. We don't want that, but we can fix it. We will use another option:

col_names = FALSE

This informs R that the first row of a file contains data; as far as R is concerned, there are no column names. As you can see from the following example, which uses Winters University data, col_names isn't too hard to use. It's just added as an argument to the read_csv() function:

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

Exercise

Read data/plants.csv into the plants variable one more time. Remember to skip the two first rows and use col_names to disable column names.

Stuck? Here's a hint!

Type:

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