Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Japan.R 2018 LT
Search
chengvt
December 01, 2018
Technology
0
610
Japan.R 2018 LT
chengvt
December 01, 2018
Tweet
Share
Other Decks in Technology
See All in Technology
業務の煩悩を祓うAI活用術108選 / AI 108 Usages
smartbank
9
19k
1万人を変え日本を変える!!多層構造型ふりかえりの大規模組織変革 / 20260108 Kazuki Mori
shift_evolve
PRO
5
910
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.5k
AI with TiDD
shiraji
1
340
純粋なイミュータブルモデルを設計してからイベントソーシングと組み合わせるDeciderの実践方法の紹介 /Introducing Decider Pattern with Event Sourcing
tomohisa
1
710
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
15
4.9k
テストセンター受験、オンライン受験、どっちなんだい?
yama3133
0
200
AWS re:Invent2025最新動向まとめ(NRIグループre:Cap 2025)
gamogamo
0
150
チームで安全にClaude Codeを利用するためのプラクティス / team-claude-code-practices
tomoki10
6
2.8k
Claude Codeを使った情報整理術
knishioka
20
12k
『君の名は』と聞く君の名は。 / Your name, you who asks for mine.
nttcom
1
150
歴史から学ぶ、Goのメモリ管理基礎
logica0419
10
2.3k
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
110
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
230
Skip the Path - Find Your Career Trail
mkilby
0
38
The agentic SEO stack - context over prompts
schlessera
0
580
A Soul's Torment
seathinner
2
2.1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
110
Being A Developer After 40
akosma
91
590k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
200
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
280
Statistics for Hackers
jakevdp
799
230k
Transcript
でRをバッチで回す Japan.R 2018 LT 2018.12.01 @chengvt り
自己紹介 nickname: チェン job: メディア系会社で二年目のアナリスト hobby:登山 R package: chengvt/MovingBubbles
Motivation • アドホック分析用データ作成+モデルを周期的に回すため、定型処理 をバッチ化したくなる • 手元のサーバで以前cron使いましたが、digdagというワークフロー エンジンに乗り換えました • 本日はdigdagでR処理を回す例を紹介
デモ やりたいこと 今年8月に生まれたパンダちゃんの 最新体重の推移を知りたい (名前投票受付中らしい)
パンダちゃんの体重はツイッター で毎日公開されています @aws_official
Rスクリプトを用意する • get_panda.R – twitterから最新情報を取得し、ファイルに保存 • plot_panda.R – 体重推移をプロットし、ファイルに保存
定形処理をバッチ化 で楽な作業に! スクリプトがあっても定期的 に実行するのは大変
digdagをサーバにインストール 詳細:https://www.digdag.io/
digファイルを書く 日本時間を使ってね 毎日17時に回してね これらのRスクリプト回 してね
ワークフローの登録 * セークレット利用やもっとカスタマイズする場合はdigdag schedulerではなくて、digdag server + digdag pushが良さそう * 「nohup
コマンド &」で端末を閉じてもログアウトしても処理を続ける digdag scheduler -n 1234 -b 127.0.0.1 Runs a workflow scheduler that runs schedules periodically. This picks up all workflow definition files named with .dig suffix at the current directory. ポート アドレス ワーキングフォルダー で実行して完了
UIがあって、Webブラウザで見れるよ 設定したアドレスとポートでアクセス 例: http://127.0.0.0:1234
便利なプラグインもあるよ • digdag-slack https://github.com/szyn/digdag-slack
まとめ • digdagでRをバッチで回す例を紹介した