Skip to content
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

vroom_fwf is not working correctly with n_max #334

Closed
jimhester opened this issue May 14, 2021 · 0 comments
Closed

vroom_fwf is not working correctly with n_max #334

jimhester opened this issue May 14, 2021 · 0 comments

Comments

@jimhester
Copy link
Collaborator

vroom::vroom_fwf(I("foo 1\nbar 2\nbaz 3\nqux 4"))
#> Rows: 4 Columns: 2
#> ── Column specification ────────────────────────────────────────────────────────
#> 
#> chr (1): X1
#> dbl (1): X2
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 4 x 2
#>   X1       X2
#>   <chr> <dbl>
#> 1 foo       1
#> 2 bar       2
#> 3 baz       3
#> 4 qux       4

vroom::vroom_fwf(I("foo 1\nbar 2\nbaz 3\nqux 4"), n_max = 2)
#> Rows: 2 Columns: 2
#> ── Column specification ────────────────────────────────────────────────────────
#> 
#> chr (2): X1, X2
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 2 x 2
#>   X1    X2               
#>   <chr> <chr>            
#> 1 foo   "1"              
#> 2 bar   "2\nbaz 3\nqux 4"

vroom::vroom_fwf(I("foo 1\nbar 2\nbaz 3\nqux 4"), n_max = 3)
#> Rows: 3 Columns: 2
#> ── Column specification ────────────────────────────────────────────────────────
#> 
#> chr (2): X1, X2
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 3 x 2
#>   X1    X2        
#>   <chr> <chr>     
#> 1 foo   "1"       
#> 2 bar   "2"       
#> 3 baz   "3\nqux 4"

vroom::vroom_fwf(I("foo 1\nbar 2\nbaz 3\nqux 4"), n_max = 4)
#> Rows: 4 Columns: 2
#> ── Column specification ────────────────────────────────────────────────────────
#> 
#> chr (1): X1
#> dbl (1): X2
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 4 x 2
#>   X1       X2
#>   <chr> <dbl>
#> 1 foo       1
#> 2 bar       2
#> 3 baz       3
#> 4 qux       4

Created on 2021-05-14 by the reprex package (v2.0.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant