> i1 <- length(list.files(pattern = '.rds'))
> while (i1 < 6195) {
+ i1 <- length(list.files(pattern = '.rds'))
+ aaa <- list.files(pattern = '.rds') %>%
+ ldply(., function(x) read_rds(path = x) %>% ncol) %>%
+ unlist %>% unique
+ print(paste0(now(), ' has ', i1, ' files with ', aaa,
+ ' columns each.'))
+ flush.console()
+ Sys.sleep(30)
+ }
[1] "2017-01-01 22:00:33 has 1054 files with 6 columns each."
[1] "2017-01-01 22:01:04 has 1057 files with 6 columns each."
[1] "2017-01-01 22:01:35 has 1061 files with 6 columns each."
[1] "2017-01-01 22:02:06 has 1064 files with 6 columns each."
readRDS(path) でエラー: コネクションからの読み取りエラーが発生しました
昨儿尝试编写shinyapp呈现后宫三千佳丽
干货:GITHUB上的一些交易策略源码,结果发现错误,6195个鸡精得重新用两天时间处理... 今儿参阅
R Sys.sleep with print not working in while loops尝试以上方式不过连接方面不稳定。尝试以下方式,结果看傻眼了! :blush: :blush: :blush:
> task <- function() {
+ i1 <- length(list.files(pattern = '.rds'))
+ aaa <- list.files(pattern = '.rds') %>%
+ ldply(., function(x) read_rds(path = x) %>% ncol) %>%
+ unlist %>% unique
+ print(paste0(now(), ' has ', i1, ' files with ', aaa,
+ ' columns each.'))
+ flush.console()
+ Sys.sleep(30)
+ }
> library(tcltk2)
> t1 <- tclTaskSchedule(wait = 30, expr = task(), redo = TRUE)
>
> t1
tclTask 'task2' scheduled after 30 ms (elapsed)
Rescheduled forever
runs:
task()
> tclTaskDelete(id = t1$id)
> task <- function() {
+ i1 <- length(list.files(pattern = '.rds'))
+ aaa <- list.files(pattern = '.rds') %>%
+ ldply(., function(x) read_rds(path = x) %>% ncol) %>%
+ unlist %>% unique
+ print(paste0(now(), ' has ', i1, ' files with ', aaa,
+ ' columns each.'))
+ flush.console()
+ Sys.sleep(30)
+ }
> library(tcltk2)
> t1 <- tclTaskSchedule(wait = 30, expr = task(), redo = TRUE)
> tclTaskDelete(id = t1$id)
> t1
tclTask 'task2' scheduled after 30 ms (elapsed)
Rescheduled forever
runs:
task()
继续加油!!!僕得干爸爹!