I have the following set of times data, that I have to convert into 12 hour format.
----------------- 814 830 1835 1730 1442 820 1430 930 1550 1725 1615 1010
You can try,
format(strptime(substr(as.POSIXct(sprintf("%04.0f", x), format="%H%M"), 12, 16), '%H:%M'), '%I:%M %p') #[1] "08:14 AM" "08:30 AM" "06:35 PM" "05:30 PM" "02:42 PM" "08:20 AM"
data
x <- c(814, 830, 1835, 1730,1442, 820)