You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The read_delim functions return the column specification used by readr as an attribute which can be accessed using spec(). However, this is not the case with the read_delim_chunked functions. The specifications are printed but cannot be accessed.
Long specifications are truncated by default, thus workarounds, like options(readr.num_columns = Inf) are needed to obtain the full spec. Meanwhile other attributes, like problems can be accessed:
read_csv_chunked(readr_example("mtcars.csv"),
callback = ListCallback$new(function(x, pos) problems(x)),
chunk_size = 20,
col_types = paste0(rep("i", 11), collapse = ""))
#> [[1]]
#> # A tibble: 85 x 4
#> row col expected actual
#> <int> <int> <chr> <chr>
#> 1 1 5 no trailing characters 3.9
#> 2 1 6 no trailing characters 2.62
#> 3 1 7 no trailing characters 16.46
#> 4 2 5 no trailing characters 3.9
#> 5 2 6 no trailing characters 2.875
#> 6 2 7 no trailing characters 17.02
#> 7 3 1 no trailing characters 22.8
#> 8 3 5 no trailing characters 3.85
#> 9 3 6 no trailing characters 2.32
#> 10 3 7 no trailing characters 18.61
#> # … with 75 more rows
#>
#> [[2]]
#> # A tibble: 49 x 4
#> row col expected actual
#> <int> <int> <chr> <chr>
#> 1 21 1 no trailing characters 21.5
#> 2 21 3 no trailing characters 120.1
#> 3 21 5 no trailing characters 3.7
#> 4 21 6 no trailing characters 2.465
#> 5 21 7 no trailing characters 20.01
#> 6 22 1 no trailing characters 15.5
#> 7 22 5 no trailing characters 2.76
#> 8 22 6 no trailing characters 3.52
#> 9 22 7 no trailing characters 16.87
#> 10 23 1 no trailing characters 15.2
#> # … with 39 more rows
Chunks have a spec_tbl_df class, which suggests to me that maybe the col spec should also be accessible?
The
read_delim
functions return the column specification used by readr as an attribute which can be accessed usingspec()
. However, this is not the case with theread_delim_chunked
functions. The specifications are printed but cannot be accessed.Long specifications are truncated by default, thus workarounds, like
options(readr.num_columns = Inf)
are needed to obtain the full spec. Meanwhile other attributes, likeproblems
can be accessed:Chunks have a
spec_tbl_df
class, which suggests to me that maybe the col spec should also be accessible?Created on 2020-11-02 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: