Here,
I am trying to insert 30 min interval for each time step using for loop.
Everything looks okay. However, the last step of rbind has changed the format.
Could anyone check this out?
Thanks
df <- as.POSIXct(c("2030-01-01 00:00:00", "2030-01-01 01:00:00",
"2030-01-01 02:00:00", "2030-01-01 03:00:00"),
format="%Y-%m-%d %H:%M:%S")
t=NULL;
for (i in 1:length(df)){
t1=df[i]
t2=t1+(30*60)
t=rbind(t,t1,t2)
}
t
Thanks @cderv for your prompt reply.
In addition to this, I do want to have the input df as well as the 30-min.
So, there will be 8 output that comes in sequence. can you check on this?