Length one character vector always guessed as character #333
Comments
I tried to figure out if this is related to a problem I'm having. It is not. But since I have it, here's the example above, stripped way down: library("readr")
(a <- read_csv("2015-12-09\n", col_names = FALSE))
#> Source: local data frame [1 x 1]
#>
#> X1
#> (chr)
#> 1 2015-12-09
(b <- read_csv("2015-12-09\n2015-12-10", col_names = FALSE))
#> Source: local data frame [2 x 1]
#>
#> X1
#> (date)
#> 1 2015-12-09
#> 2 2015-12-10
class(a$X1)
#> [1] "character"
class(b$X1)
#> [1] "Date" |
Even more minimal: read_csv("1\n", col_names = FALSE)
#> Source: local data frame [1 x 1]
#>
#> X1
#> <chr>
#> 1 1 Likely to be an off-by-one error |
After bisecting 0cb2d0b is the commit that introduced this bug |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have trouble attaching files, so I just put the content of the files here since they are simple.
I found a surprising behavior using read_csv function in readr package. The format of date is different when the input file has only one row vs. multiple rows.
Could you please take a look and see if this is a bug or user error?
Thanks a lot!
file1.csv
file2.csv
readr_test.R
The text was updated successfully, but these errors were encountered: