-
Notifications
You must be signed in to change notification settings - Fork 286
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
add comment arg to read_table #563
Conversation
tokenizer_fwf already has an option for comment, but for some reason this seems to have been omitted from read_table, though it is present in all other `read_` methods (and in `read.table()`). Adding it back here.
This will also need to be fed in to |
Thanks! The repo this PR comes from seems to have gone off into the nether, but I re-created your commit manually (d65b23d) with Hadley's suggestion. |
@jimhester apologies, it looks like my commit didn't actually fix the issue so I removed it. That change allows Here's a reproducible example (from a classic data set): read_table("ftp://aftp.cmdl.noaa.gov/products/trends/co2/co2_mm_mlo.txt",
comment = "#) |
As of 7ab8634 this show now work properly library(readr)
read_table("ftp://aftp.cmdl.noaa.gov/products/trends/co2/co2_mm_mlo.txt",
comment = "#", col_names = FALSE)
#> cols(
#> X1 = col_integer(),
#> X2 = col_integer(),
#> X3 = col_double(),
#> X4 = col_double(),
#> X5 = col_double(),
#> X6 = col_double(),
#> X7 = col_integer()
#> )
#> # A tibble: 706 × 7
#> X1 X2 X3 X4 X5 X6 X7
#> <int> <int> <dbl> <dbl> <dbl> <dbl> <int>
#> 1 1958 3 1958.208 315.71 315.71 314.62 -1
#> 2 1958 4 1958.292 317.45 317.45 315.29 -1
#> 3 1958 5 1958.375 317.50 317.50 314.71 -1
#> 4 1958 6 1958.458 -99.99 317.10 314.85 -1
#> 5 1958 7 1958.542 315.86 315.86 314.98 -1
#> 6 1958 8 1958.625 314.93 314.93 315.94 -1
#> 7 1958 9 1958.708 313.20 313.20 315.91 -1
#> 8 1958 10 1958.792 -99.99 312.66 315.61 -1
#> 9 1958 11 1958.875 313.33 313.33 315.31 -1
#> 10 1958 12 1958.958 314.67 314.67 315.61 -1
#> # ... with 696 more rows |
tokenizer_fwf already has an option for comment, but for some reason this seems to have been omitted from read_table, though it is present in all other
read_
methods (and inread.table()
). Adding it back here.