Reputation: 1702
I have a dataframe with values in minutes
0 , 30 , 60 ... 1410
I need to cast them as
00:00:00, 00:30:00, 01:00:00 ... 23:30:00
How can I achieve this using R.
Thanks
Upvotes: 0
Views: 45
Reputation: 887851
We could try
sprintf("%d:%02d:00", v1%/%60, v1%%60)
#[1] "0:00:00" "0:30:00" "1:00:00" "23:30:00"
v1 <- c(0, 30, 60, 1410)
Upvotes: 3