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