Hi,
I want to create a dataframe running a code every 30 seconds.
get_lokasyon()
gives me a data frame. I want to query with get_lokasyon()
every 30 seconds and add the results one after another but df_total gives me only last running get_lokasyon()
library(tcltk)
df_total = data.frame()
run <- function () {
.id <<- tcl("after", 30000, run) # after 30000 ms execute run() again
df <- get_lokasyon()
df_total <- rbind(df_total,df)
print(df_total)
}
run()
Example result of get_lokasyon()
:
Operator Garaj KapiNo Saat Boylam Enlem
1 OHO AA 16:24:51 29.037663 41.12744
After 90 seconds I want:
Operator Garaj KapiNo Saat Boylam Enlem
1 OHO AA 16:24:51 29.037663 41.12744
2 OHO AA 16:25:40 29.037663 41.12744
3 OHO AA 16:26:10 29.037663 41.12744
Thank you