I used the lubridate package's parse_date_time() to convert SleepTime from character strings to date/time values. Then we can break the date and time apart with as.Date() and format:
Thanks for the solution. As you can see from the image i uploaded, there are two SleepDay column that appears when I select the first one I'm able to extract only the date(time column is not created) but when i select the last one i get both the time and date column. Also if you dont mind, can you please tell why you used an I and p(I:M:%S %p") here.
The "I" refers to an hour (1-12) in a time string, the p refers to an AM/PM indicator. You can find all these symbols by typing ? strptime in the R console.
I sort of made a mess in the original answer. When you use strptime() you need to include the percent sign with these all of these symbols (%M, %I , %p, etc.), but you don't need the percent sign with lubridate functions (it will just ignore them). I likely confused things by including some with the percent symbol and some without. I've corrected the code above.