0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[R言語 / rlang] プログレスバーを表示させたい

Posted at

概要

タイトルの通り( *˙︶˙*)وグッ!

実行環境

  • Google Cloud Platform の VertexAI
  • jupyter notebook

ソースコード

これで実現できた。

R言語
length <- 100000

pb <- txtProgressBar(min = 0, max = length, style = 3)


# 空のリストを作成
list_index = list()
count = 0
for (index in 1:length){
    if (index %% 1000 == 0) {
        list_index = append(list_index, index)
    }
    count = count + 1
    setTxtProgressBar(pb, count)
}

実行結果

こんな感じになって、リアルタイムに進捗が更新されるよ!( *¯ ꒳¯*)✨

スクリーンショット 2024-05-22 9.18.35.png

補足

もしかしたら何かライブラリ使っているのかもしれないけど、 VertexAI 上だったからなのか、意識せずに、 txtProgressBar などを呼び出すことができた。

ローカルマシン上だとこうはいかないのかもしれない[壁]д・)チラッ

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?