Custom wrapper around readr::type_convert()
that suppresses warnings and
copies labels, in order to (mostly) match the behavior of
cb_apply_col_spec()
. but without re-implementing a lot of functionality.
Arguments
- df
The
data.frame
to process.- col_types
The
col_spec
to apply.- ...
Other arguments to
readr::type_convert()
.
Value
A data.frame
based on d
, with any factor columns specified in
col_types
converted to factor
and any other columns processed
according to the functionality of readr::type_convert()
Details
A known key difference compared cb_apply_col_spec()
is that df
is fully
processed according to the col_types
argument, meaning that other columns
may be converted in addition to the factor columns.