diff --git a/import.Rmd b/import.Rmd index dcd9ad9..d2e7c8c 100644 --- a/import.Rmd +++ b/import.Rmd @@ -472,39 +472,25 @@ There are two printed outputs: the column specification generated by looking at problems(challenge) ``` -A good strategy is to work column by column until there are no problems remaining. Here we can see that there are a lot of parsing problems with the `x` column - there are trailing characters after the integer value. That suggests we need to use a double parser instead. - -To fix the call, start by copying and pasting the column specification into your original call: - -```{r, eval = FALSE} -challenge <- read_csv( - readr_example("challenge.csv"), - col_types = cols( - x = col_integer(), - y = col_character() - ) -) -``` - -Then you can tweak the type of the `x` column: - -```{r} -challenge <- read_csv( - readr_example("challenge.csv"), - col_types = cols( - x = col_double(), - y = col_character() - ) -) -``` - -That fixes the first problem, but if we look at the last few rows, you'll see that they're dates stored in a character vector: +A good strategy is to work column by column until there are no problems remaining. Here we can see that there are a lot of parsing problems with the `y` column. If we look at the last few rows, you'll see that they're dates stored in a character vector: ```{r} tail(challenge) ``` -You can fix that by specifying that `y` is a date column: +That suggests we need to use a date parser instead. To fix the call, start by copying and pasting the column specification into your original call: + +```{r, eval = FALSE} +challenge <- read_csv( + readr_example("challenge.csv"), + col_types = cols( + x = col_double(), + y = col_logical() + ) +) +``` + +Then you can fix the type of the `y` column by specifying that `y` is a date column: ```{r} challenge <- read_csv(