date_col <- c(lubridate::ymd(20180101), lubridate::ymd(20210420))
tibble::tibble(int = c(1L, 2L),
fct = factor(c(10, 11)),
date = date_col,
chr = c("a2.1", "rtg50.5")) -> t1
t1
t1 %>%
set_dbl(tidyselect::everything())
# s3 method works for vectors individually
# custom date coercion to represent date as a number. For lubridate's coercion method, use set_int
date_col %>%
set_dbl
Run the code above in your browser using DataLab