Referencing #895 feature request, which notes that as.col_spec() in the development branch can be used to generate a short/text col spec for existing data frames:
This fails in the current HEAD branch for data frames with logical columns because col_to_short() is missing collector_logical = "l' (I don't see any other missing types):
Reprex:
library(readr)
# This works
as.character(readr::as.col_spec(mtcars))
#> [1] "ddddddddddd"
# This fails
mtcars2 <- mtcars
mtcars2$gas_guzzler <- mtcars2$mpg < 15
as.character(readr::as.col_spec(mtcars2))
#> Error in vapply(x$cols, col_to_short, character(1)): values must be length 1,
#> but FUN(X[[12]]) result is length 0
Referencing #895 feature request, which notes that
as.col_spec()in the development branch can be used to generate a short/text col spec for existing data frames:This fails in the current HEAD branch for data frames with logical columns because
col_to_short()is missingcollector_logical = "l'(I don't see any other missing types):readr/R/col_types.R
Line 180 in 084eccf
Reprex: