Skip to content

read_table silently drops row when reading FWF file #254

@kevinushey

Description

@kevinushey

Given a file with the contents:

foo bar baz
1   2   3
4   5   6
7   8   9

readr silently drops the second line:

readr::read_table(file = "foo bar baz\n1   2   3\n4   5   6\n7   8   9\n")
> str(readr::read_table(file = "foo bar baz\n1   2   3\n4   5   6\n7   8   9\n"))
Classestbl_df’, ‘tbland 'data.frame':       2 obs. of  3 variables:
 $ foo: int  1 7
 $ bar: int  2 8
 $ baz: num  3 9
> devtools::session_info()
Session info -------------------------------------------------------------------
 setting  value
 version  R version 3.2.2 Patched (2015-09-09 r69342)
 system   x86_64, darwin13.4.0
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 tz       America/Los_Angeles

Packages -----------------------------------------------------------------------
 package       * version    date       source
 BiocInstaller * 1.18.4     2015-09-03 Bioconductor
 crayon          1.3.1      2015-07-13 CRAN (R 3.2.0)
 curl            0.9.3      2015-08-25 CRAN (R 3.2.1)
 devtools      * 1.8.0      2015-05-09 CRAN (R 3.2.0)
 digest          0.6.8      2014-12-31 CRAN (R 3.2.0)
 git2r           0.11.0     2015-08-12 CRAN (R 3.2.0)
 knitr         * 1.11       2015-08-14 CRAN (R 3.2.1)
 memoise         0.2.1      2014-04-22 CRAN (R 3.2.0)
 Rcpp            0.12.1     2015-09-10 CRAN (R 3.2.2)
 readr         * 0.1.1.9000 2015-09-14 Github (hadley/readr@482c17f)
 rversions       1.0.2      2015-07-13 CRAN (R 3.2.0)
 testthat      * 0.10.0     2015-05-22 CRAN (R 3.2.0)
 xml2            0.1.2      2015-09-01 CRAN (R 3.2.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions