Skip to content

read_table2: warnings with comments char #908

Closed

Description

@dkulp2

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)

Activity

  1. added
    bugan unexpected problem or unintended behavior
    on Nov 13, 2018
  2. lock commented on May 13, 2019

    @lock

    This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

  3. locked and limited conversation to collaborators on May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions