tidyverse/readxl

Force col_types for vector of known columns, default guess for other columns

Closed this issue · 1 comments

Reading a mutable xlsx when you know few of the columns names, it would be great to call col_types as cols function, using

col_types = cols(.default = "?",  known_mixed_column = "c")

This approach is used in readr::read_csv2, and brings great functionality, that is not confused with guess_max = n_max, when I want to force types.
Current implementation of coltypes requires either NULL to guess all from the spreadsheet or a character vector containing one entry per column from these options: "skip", "guess", "logical", "numeric", "date", "text" or "list".
This approach is not possible when you still don't know the whole spreadsheet content.

Already opened discussion and implementation in #198, with temporary workaround.