New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_table2: warnings with comments char #908

Closed
dkulp2 opened this Issue Nov 6, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@dkulp2

dkulp2 commented Nov 6, 2018

What's all this fuss about. I can't decipher the warnings that are printed, but clearly the parser is not silently ignoring characters after the comment character, like the documentation says.

Is this a bug or user error? (read.table deals with this correctly without objection.)

> s <- "# ignore\nA B # comment\nC  D  #another comment\n#ignore this too"
> cat(s)
# ignore
A B # comment
C  D  #another comment
#ignore this too
> readr::read_table2(s, comment = '#', col_names=c('C1','C2'))
Warning: 3 parsing failures.
row # A tibble: 3 x 5 col     row col   expected  actual    file         expected   <int> <chr> <chr>     <chr>     <chr>        actual 1     1 NA    2 columns 4 columns literal data file 2     2 NA    2 columns 4 columns literal data row 3     3 NA    2 columns 1 columns literal data

# A tibble: 3 x 2
  C1    C2   
  <chr> <chr>
1 A     B    
2 C     D    
3 NA    NA   
Warning message:
In rbind(names(probs), probs_f) :
  number of columns of result is not a multiple of vector length (arg 1)

@jimhester jimhester added the bug label Nov 13, 2018

@jimhester jimhester closed this in 3215e84 Nov 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment