Open
Description
Also from R4DS:
Sometimes it's easier to diagnose problems if you just read in all the columns as character vectors:
#| eval: false
df <- read_csv(
"challenge.csv",
col_types = cols(.default = col_character())
)
If you're having major parsing problems, sometimes it's easier to just read into a character vector of lines with read_lines()
:
#| eval: false
df <- read_lines("challenge.csv")
Then you can use dplyr and the tools you'll learn in @sec-strings to figure out what's going wrong.