- Use the
read_csvfunction to read each of the files that the following code saves in the
path <- system.file("extdata", package = "dslabs") files <- list.files(path) files
- Note that the last one, the
olivefile, gives us a warning. This is because the first line of the file is missing the header for the first column.
Read the help file for
read_csv to figure out how to read in the file without reading this header. If you skip the header, you should not get this warning. Save the result to an object called
- A problem with the previous approach is that we don’t know what the columns represent. Type:
to see that the names are not informative.
readLines function to read in just the first line (we later learn how to extract values from the output).