I am not very familiar with using loops. I am trying to create a table like this: 00:00 00:01 00:02 ... 27:58 27:59 28:00
It is for data that runs into the next day, but is still considered part of the original day.
I tried this:
hh<-c(seq('00','28',1))
mm<-c(seq('01','60',1))
for (i in (1:29)) {
int<-paste(hh[i],":",mm)
}
View(int)
but it only does the pastes minutes 1 through 60 onto hour 28: only the 28th hour
I hope this is simpler than I am making it out to be, I don't know how to use the sapply or lapply to do this. Thanks for any help.
You can do this with the help of
outer
:sprintf
appends 0 to a single digit number and wepaste
every hour (0 to 27) to every minute (0 to 59).