目标
在R语言的循环中,添加进度条
实例
library(progress)
## Basic 基础版
pb <- progress_bar$new(total = 100, clear = FALSE)
for (i in 1:100) {
pb$tick()
Sys.sleep(1 / 100)
}
参数
total : for循环的长度。 Total number of ticks to complete
clear: Whether to clear the progress bar on completion. Defaults to TRUE.