LoginSignup
9
8

More than 5 years have passed since last update.

Rでプログレスバー(windows)

Posted at

参照

# 初期ウィンドウを用意
pb <- winProgressBar(title="Example progress bar", label="0% done", min=0, max=100, initial = 0)

# スリープを挟んだサンプル
for(i in 1:100) {
  Sys.sleep(0.1)
  info <- sprintf("%d%% done", round((i/100)*100))
  setWinProgressBar(pb, i/(100)*100, label=info)
}

# プログレスバーウィンドウを閉じる
close(pb)

コンソール上に表示させる場合

pb <- txtProgressBar(title="Example progress bar", label="0% done", min=0, max=100, initial = 0)
for(i in 1:1000) {
  Sys.sleep(0.1)
  setTxtProgressBar(pb, i/(100)*100)
}
close(pb)
9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8