# NOT RUN {
# Use `exibble` to create a gt table;
# keep only the `date` and `time` columns;
# format the `date` column to have
# dates formatted as `month_day_year`
# (date style `5`)
tab_1 <-
exibble %>%
dplyr::select(date, time) %>%
gt() %>%
fmt_date(
columns = vars(date),
date_style = 5
)
# Use `exibble` to create a gt table;
# keep only the `date` and `time` columns;
# format the `date` column to have mixed
# date formats (dates after April will
# be different than the others)
tab_2 <-
exibble %>%
dplyr::select(date, time) %>%
gt() %>%
fmt_date(
columns = vars(date),
rows =
as.Date(date) > as.Date("2015-04-01"),
date_style = 6
) %>%
fmt_date(
columns = vars(date),
rows =
as.Date(date) <= as.Date("2015-04-01"),
date_style = 7
)
# }
Run the code above in your browser using DataLab