This can be done with formattable.
For example
library(formattable)
# Sample vector of time values
times <- c("09:30:00", "13:45:00", "20:15:00", "03:00:00")
# Convert times to POSIXlt format for easier formatting
times_posix <- as.POSIXlt(times, format = "%H:%M:%S")
# Define a formatting function to convert POSIXlt format to clock format
clock_format <- function(x) {
format(x, format = "%I:%M %p")
}
# Use formattable to apply the clock formatting to the vector of times
(ftimes <- formattable(times_posix,
formatter = clock_format))