problems() not pulling up the exact text of a parsing failure #548
Comments
Simpler reprex: problems(read_tsv("x\n1\nx", na = "", col_types = "n")) This is ok: problems(read_tsv("x\n1\nx", na = "", col_types = "d")) So probably a buglet in the number collector. |
jimhester
added a commit
to jimhester/readr
that referenced
this issue
Feb 9, 2017
jimhester
added a commit
that referenced
this issue
Feb 9, 2017
Thanks for the fix! I found another case which fails, even after the fix:
|
Looks correct to me, what do you expect the output to be? library(readr)
problems(read_tsv("(-)\n1\n(-)", na = "", col_types = "n"))
#> # A tibble: 1 × 4
#> row col expected actual
#> <int> <chr> <chr> <chr>
#> 1 2 (-) a number - |
The "-" should be "(-)".
On mobile.
On Feb 24, 2017 1:54 PM, "Jim Hester" <notifications@github.com> wrote:
Looks correct to me, what do you expect the output to be?
library(readr)
problems(read_tsv("(-)\n1\n(-)", na = "", col_types = "n"))#> # A
tibble: 1 × 4#> row col expected actual#> <int> <chr> <chr>
<chr>#> 1 2 (-) a number -
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#548 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFFKkXhSFmqRZecvols5EwB6AUgJp3Pgks5rf1GRgaJpZM4Kqpu2>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The example:
Now try and parse with the incorrect NA specification (in the real application it's not obvious exactly what represents NA).
I would have expected this to come up:
Is this the expected behavior?
The text was updated successfully, but these errors were encountered: