I have a data set which includes times that people go to bed ranging from about 2130 until about 0100. I have managed to format it so that they are written as 2245, for example, and they are numeric variables so that 2245 is later, or more than 2145. But anytime later than 2359, is written as less than 4 digits. For example, what should be written as 0000 (12am) is simply 0. How can I format these numbers so that 12am (or any other similar time) is written as 0000? Thank you for the help!
Edit: I would still like to keep it as a numeric variable. I have tried using the formatC function but it turns my data into character variables (so 2230 is no longer larger/later than 2130).