---
title: teal の話
tags:  #r with pharma lab meetup 1  
author: [森岡裕[SASユーザー総会世話人]](https://www.docswell.com/user/6484025)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/L73WP4KD75.jpg?width=480
description: teal の話 by 森岡裕[SASユーザー総会世話人]
published: April 06, 26
canonical: https://www.docswell.com/s/6484025/KN71J7-2026-04-06-113122
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/L73WP4KD75.jpg)

1
teal
の話
西川 寛来
2026-04-08
R with Pharma Lab#1


# Page. 2

![Page Image](https://bcdn.docswell.com/page/87DKLQ32JG.jpg)

スライドはこちら
2
https://nissinbo.github.io/RwPL_1_teal/
R with Pharma Lab#1


# Page. 3

![Page Image](https://bcdn.docswell.com/page/VJPK2L4LE8.jpg)

自己紹介
3
西川寛来
製薬業界で修行中
LinkedIn
GitHub
R with Pharma Lab#1


# Page. 4

![Page Image](https://bcdn.docswell.com/page/2EVVDQX6EQ.jpg)

こんな話をします 🙆
4
とはなにか
“あの日の CRAN” を使う
OSS contribution について
teal
R with Pharma Lab#1


# Page. 5

![Page Image](https://bcdn.docswell.com/page/57GLYWV2EL.jpg)

5
teal
とはなにか
R with Pharma Lab#1


# Page. 6

![Page Image](https://bcdn.docswell.com/page/4EQYM369JP.jpg)

6
teal
で治験データ分析ダッシュボードを作るための R
パッケージ
Shiny
GitHub
社の Insights Engineering が開発
teal を用いた FDA submission の検証が行われた
Roche/Genentech
Submission Pilot 2, Shiny app
Submission Pilot 4, Shiny app
R with Pharma Lab#1


# Page. 7

![Page Image](https://bcdn.docswell.com/page/KJ4WV1MR71.jpg)

活用場面
7
データモニタリング
照会事項対応
事後解析
探索的な解析
(将来的には) 承認申請
💁 治験データのダッシュボードでやれることは多い
R with Pharma Lab#1


# Page. 8

![Page Image](https://bcdn.docswell.com/page/LE1Y3G8V7G.jpg)

製薬企業の採用事例
8
GSK
PHUSE US Connect 2024
Sanofi
PHUSE US Connect 2025
BMS, JnJ, Sanofi, Roche
PHUSE Working Group Events
これ以外にも事例は増えている印象。日本でもやっていきましょう
R with Pharma Lab#1


# Page. 9

![Page Image](https://bcdn.docswell.com/page/GEWGPKZ3J2.jpg)

teal
で作った Shiny はこんな感じ 🙋
teal.gallery efficacy
1.00
0:00 / 1:19
R with Pharma Lab#1
9


# Page. 10

![Page Image](https://bcdn.docswell.com/page/47ZLKZ1GJ3.jpg)

R with Pharma Lab#1


# Page. 11

![Page Image](https://bcdn.docswell.com/page/YJ6WQZLQJV.jpg)

実装の雰囲気
10
app.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# load libraries
library(teal)
library(teal.modules.general)
library(teal.widgets)
library(sparkline)
1
# teal_data object
data &lt;- teal_data()
data &lt;- within(data, {
ADSL &lt;- teal.data::rADSL
ADTTE &lt;- teal.data::rADTTE
})
join_keys(data) &lt;- default_cdisc_join_keys[names(data)]
2
# initialize the app
app &lt;- init(
data = data,
modules = modules(
3
治験データでよく行われる分析手法をモジュールとして利用可能
裏では tern パッケージが動いている
R with Pharma Lab#1


# Page. 12

![Page Image](https://bcdn.docswell.com/page/GJ5MRW12J4.jpg)

teal
を使うメリット
11
インタラクティブな探索
ユーザー自身でフィルタの操作や、カスタムレポートを出力
解析部門の負担を減らし、エンドユーザーの満足度を高める
コード管理による効率性と再現性
試験間での横展開がしやすい
アプリ上の操作を再現する R コードを出力
モジュールによる標準化
生物統計に特化しており、要求に素早く対応
ダッシュボードの作り方を揃えやすい
R with Pharma Lab#1


# Page. 13

![Page Image](https://bcdn.docswell.com/page/9E29DQ117R.jpg)

モジュールの探し方
12
R with Pharma Lab#1


# Page. 14

![Page Image](https://bcdn.docswell.com/page/D7Y42WZ4EM.jpg)

teal.modules.*
のパッケージで各モジュールが利用可能
teal.modules.general, teal.modules.clinical
R with Pharma Lab#1


# Page. 15

![Page Image](https://bcdn.docswell.com/page/VENY8936J8.jpg)

UI
で簡単にデータをフィルタリング
R with Pharma Lab#1
13


# Page. 16

![Page Image](https://bcdn.docswell.com/page/Y79PK29RE3.jpg)

R with Pharma Lab#1


# Page. 17

![Page Image](https://bcdn.docswell.com/page/G78DR59G7D.jpg)

カスタムレポートを作る
14
表やグラフを組み合わせてレポートを出力可能 (html, pdf, pptx, docx)
R with Pharma Lab#1


# Page. 18

![Page Image](https://bcdn.docswell.com/page/L7LMKYWXJR.jpg)

アプリ上の操作をコードとして出力
https://rinpharma.shinyapps.io/nest_efficacy_stable/
R with Pharma Lab#1
15


# Page. 19

![Page Image](https://bcdn.docswell.com/page/4EMY2N93EW.jpg)

コードをコピペして実行すると…
R with Pharma Lab#1
16


# Page. 20

![Page Image](https://bcdn.docswell.com/page/PER9MDGRJ9.jpg)

結果が再現された！
17
Code
Table of BESRSPI for CR and PR Responders
Stratified by STRATA1
——————————————————————————————————————————————————————————————————————————————
A: Drug X
B: Placebo
C: Combination
(N=133)
(N=141)
(N=126)
——————————————————————————————————————————————————————————————————————————————
Responders
131 (98.5%)
134 (95.0%)
126 (100.0%)
95% CI (Wald, with correction)
(96.1, 100.0)
(91.1, 99.0)
(99.6, 100.0)
R with Pharma Lab#1


# Page. 21

![Page Image](https://bcdn.docswell.com/page/P7XQV1XYEX.jpg)

teal
の歴史を歩む
v0.16.0 -&gt; v1.0.0
18
にメジャーアップデートした際の Changelog を見てみる
R with Pharma Lab#1


# Page. 22

![Page Image](https://bcdn.docswell.com/page/37K9Q2W47D.jpg)

v1.0.0
で何が変わった？
19
「UI を大幅刷新、bslib 使ってレイアウト改善したよ」とのこと
R with Pharma Lab#1


# Page. 23

![Page Image](https://bcdn.docswell.com/page/LJ3WP41DJ5.jpg)

UI
を比べてみる
v0.16.0
20
v1.0.0
めっちゃ変わった!!!
全体的にモダンなデザイン
モジュール選択がタブからドロップダウンに
フィルタパネルの位置が変わった
R with Pharma Lab#1


# Page. 24

![Page Image](https://bcdn.docswell.com/page/8JDKLQX2EG.jpg)

21
あの日の CRAN” を使う
“
R with Pharma Lab#1


# Page. 25

![Page Image](https://bcdn.docswell.com/page/VEPK2LPL78.jpg)

バージョンを指定してインストールはできるけど…
パッケージのインストールには pak::pak() が便利です。使いましょう。
1 # バージョンを指定してインストール
2 pak::pak(&quot;teal@1.0.0&quot;)
デフォルトでは CRAN binary archive から指定バージョンをインストール
指定したパッケージ以外は「本日の CRAN」を参照する
依存パッケージはどうなる？
複数パッケージをバージョン指定してダウンロードしたい時は？
🤔 依存パッケージなども含めて”当時の環境”をそのまま再現したい
R with Pharma Lab#1
22


# Page. 26

![Page Image](https://bcdn.docswell.com/page/27VVDQ267Q.jpg)

P3M
とは？
23
Posit Public Package Manager (P3M)
社が提供する パッケージリポジトリ
指定した日付の CRAN snapshot を利用可能
Windows の例: https://packagemanager.posit.co/cran/2025-08-21
Posit
R with Pharma Lab#1


# Page. 27

![Page Image](https://bcdn.docswell.com/page/5JGLYWR27L.jpg)

P3M
を使って”あの日の CRAN” を使う
pak::repo_add()
1
2
3
4
5
6
7
8
や pak::repo_resolve() で CRAN snapshot をリポジトリとして追加する
# パッケージのバージョンを指定すると、CRAN リリースの翌日の snapshot を参照する
pak::repo_add(CRAN = pak::repo_resolve(&quot;PPM@teal-1.0.0&quot;))
# 直接日付を指定してもOK
pak::repo_add(CRAN = &quot;PPM@2025-08-21&quot;)
# 指定した CRAN snapshot でインストール
pak::pak(&quot;teal&quot;)
💁️ “あの日の CRAN” を使うテクニックは、製薬業界や承認申請周りで重要になりそう
R with Pharma Lab#1
24


# Page. 28

![Page Image](https://bcdn.docswell.com/page/47QYM3V9EP.jpg)

25
OSS contribution
について
R with Pharma Lab#1


# Page. 29

![Page Image](https://bcdn.docswell.com/page/KE4WV1WRJ1.jpg)

teal
に貢献してみよう
26
コミュニティが活発
プレゼンテーション・ウェビナーも頻繁に開催
Pharmaverse Slack のチャンネルもある
機能追加の要望が多い
バグ報告 (= 伸びしろ) もまだまだある
開発チームが親切で、初心者歓迎の雰囲気
他社の統計プログラマーとの協働の機会
R with Pharma Lab#1


# Page. 30

![Page Image](https://bcdn.docswell.com/page/L71Y3GYVJG.jpg)

OSS contribution
の流れ
27
興味のある issue を見てみる
good first issueから選ぶとよさそう
例: ggplot2 の deprecated な関数を置き換える
2. Fork して修正・動作確認
3. Pull Request 送信
4. レビュー対応 → マージ 🎉
1.
R with Pharma Lab#1


# Page. 31

![Page Image](https://bcdn.docswell.com/page/G7WGPKG3E2.jpg)

PR
を送ってみた
28
の重複削除で余計な列が入る問題
AE summary table のフィルタのバグ
些細な貢献かもしれないが、自分が使っているツールを自分で改善する体験は楽しい
data table
R with Pharma Lab#1


# Page. 32

![Page Image](https://bcdn.docswell.com/page/4JZLKZLGE3.jpg)

29
まとめ
R with Pharma Lab#1


# Page. 33

![Page Image](https://bcdn.docswell.com/page/YE6WQZWQEV.jpg)

やっていきましょう
30
🤝 teal
治験データのダッシュボード作成に最適
多くの企業で採用実績あり
エンドユーザーが自分でレポートを作れる
P3M で”あの日の CRAN” を使おう
♥️ OSS contribution
まずは good first issue から
自分が使っているツールを自分で改善できる
R with Pharma Lab#1


# Page. 34

![Page Image](https://bcdn.docswell.com/page/GE5MRWM2E4.jpg)

31
Enjoy 🙋
R with Pharma Lab#1


# Page. 35

![Page Image](https://bcdn.docswell.com/page/9729DQ91JR.jpg)

紹介しきれなかった teal のお役立ちリンク
大阪SAS勉強会: Be lazy with teal
YouTube: teal workshop
PHUSE US Connect 2024 Roche
PHUSE US Connect 2025 CIM Global
PHUSE US Connect 2025 Roche
PHUSE US Connect 2026 Pfizer
YouTube: Implementation of {teal} Shiny apps in DMC activity
Appsilon Blog: Innovating pharma with teal
Appsilon Blog: tealflow
R with Pharma Lab#1
32


