Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
BeginnersSession2 - Plot & Visualization-
Search
yu_sekiya
October 03, 2026
Programming
62
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
BeginnersSession2 - Plot & Visualization-
TokyoR#122の初心者セッション2可視化の資料です
yu_sekiya
October 03, 2026
More Decks by yu_sekiya
See All by yu_sekiya
目指せ shiny中級者 ~ shiny Modules を使ってみた~
kotatyamtema
0
42
TokyoR#119 rvestでhtml_liveをさわってみた話
kotatyamtema
0
77
TokyoR#119 bignners session2 Visualization
kotatyamtema
0
260
Shinyのすすめ - Introduction to shiny -
kotatyamtema
0
190
TokyoR116_BeginnersSession1_環境構築
kotatyamtema
0
290
TokyoR#114 shiny+DT超(ザックリ)入門
kotatyamtema
0
120
TokyoR#113 bignners session2 Visualization
kotatyamtema
0
150
TokyoR #112 Beginners' Session2 data handing
kotatyamtema
0
160
TokyoR #111 Beginners' Session1 data handing
kotatyamtema
0
120
Other Decks in Programming
See All in Programming
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
280
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
580
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
150
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
130
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
420
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.1k
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
6.2k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
430
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
110
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
300
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2.2k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Into the Great Unknown - MozCon
thekraken
41
2.8k
How STYLIGHT went responsive
nonsquared
100
6.3k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
520
Building AI with AI
inesmontani
PRO
1
1.3k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
520
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Unsuck your backbone
ammeep
672
58k
Transcript
初心者セッション2 - Plot & VisualizationTokyo.R #122 @kotatyamtema 1
自己紹介 TwitterID : @kotatyamtema 大学での専門: 行動生態学 立案~捕獲~実験~分析までワンオペ 今まで : 客先ぼっち分析屋→アパレル通販会社
現在 : 医療検査会社 R歴 : 10年過ぎたはず?永遠の初心者 近況 : 自分の存在意義を見失いそうな今日この頃… 晴天と睡眠時間が足りない…
目的 なぜデータの可視化が必要なのか ggplot2を使って基本的な作図が できるようになる
目次 1. 「データを可視化する」とは 2. なぜ可視化が必要なのか 3. Rで作図 - ggplot2入門 4.
さまざまなグラフと使い方
MENU 1. 「データを可視化する」とは 2. なぜ可視化が必要なのか - 要約値の落とし穴 - 適切な種類の選択 3.
Rで作図 - ggplot2入門 - 使用データ(penguins) - ggplot2の作図概念 - 基本の書き方 4. さまざまなグラフと使い方 - グラフの種類と使い方 - 主なグラフのサンプル - ヒストグラム - 棒グラフ - 箱ひげ図 - 散布図 - 折れ線グラフ
MENU 1. 「データを可視化する」とは 2. なぜ可視化が必要なのか - 要約値の落とし穴 - 適切な種類の選択 3.
Rで作図 - ggplot2入門 - 使用データ(penguins) - ggplot2の作図概念 - 基本の書き方 4. さまざまなグラフと使い方 - グラフの種類と使い方 - 主なグラフのサンプル - ヒストグラム - 棒グラフ - 箱ひげ図 - 散布図 - 折れ線グラフ
「データを可視化する」とは データの理解への最初の一歩 - 要約値では見逃してしまう異常の検知 - 言語化しにくい情報の共有 - 上司や意思決定層への効果的なプレゼン資料 情報量が多いので効果的に使おう
MENU 1. 「データを可視化する」とは 2. なぜ可視化が必要なのか - 要約値の落とし穴 - 適切な種類の選択 3.
Rで作図 - ggplot2入門 - 使用データ(penguins) - ggplot2の作図概念 - 基本の書き方 4. さまざまなグラフと使い方 - グラフの種類と使い方 - 主なグラフのサンプル - ヒストグラム - 棒グラフ - 箱ひげ図 - 散布図 - 折れ線グラフ
なぜ可視化が必要なのか - 要約値には落とし穴がある 平均/標準偏差ではデータの分布を表現しきれない
なぜ可視化が必要なのか - 要約値には落とし穴がある 平均/標準偏差ではデータの分布を表現しきれない https://visualizing.jp/the-datasaurus-dozen/
なぜ可視化が必要なのか - 統計値にも落とし穴がある シンプソンのパラドックス(Simpson's paradox) →データ全体の相関とグループごとの相関は一致しないことがある
なぜ可視化が必要なのか - 適切な種類の図の選択が重要 不適切な図を使うと分かりにくいだけでなく 印象操作やミスリーディングを招く 撲滅祈願!! 3D円グラフ
上手に可視化して より深いデータの 理解を
MENU 1. 「データを可視化する」とは 2. なぜ可視化が必要なのか - 要約値の落とし穴 - 適切な種類の選択 3.
Rで作図 - ggplot2入門 - 使用データ(penguins) - ggplot2の作図概念 - 基本の書き方 4. さまざまなグラフと使い方 - グラフの種類と使い方 - 主なグラフのサンプル - ヒストグラム - 棒グラフ - 箱ひげ図 - 散布図 - 折れ線グラフ
使用データ 今回使用するデータはpalmerpenguinsパッケージに入っている “penguins”データ*1 →事前に欠測値を除外 →必要に応じて要約値を算出 Artwork by @allison_horst https://allisonhorst.github.io/palmerpenguins/ *1:現在はデフォルトに入っていますが、カラムなどが若干異なるため元々のパッケージのデータを使用
ggplot2の作図概念 ggplot2とは tidyversの中で用意されている作図用package photoshopやIllustratorのように レイヤーを重ねていくイメージで作図 ggplot() + geom̲XXX + scale̲*̲****
基本の書き方 ## 関数の間は ”+” でつなぐ plot1 <- ggplot(data = penguin̲plotdata,
aes(x = body̲mass̲g, y = ipper̲length̲mm)) + geom̲point(aes(colour = species, shape = sex)) 保存方法 fi fl ggsave(plot = plot1, le = “plot.png”, units = “mm”, width = 1200, height = 800, dpi = 100)
基本の書き方 ggplotのレイヤーの実例
基本の書き方
基本の書き方
基本の書き方
基本の書き方
MENU 1. 「データを可視化する」とは 2. なぜ可視化が必要なのか - 要約値の落とし穴 - 適切な種類の選択 3.
Rで作図 - ggplot2入門 - 使用データ(penguins) - ggplot2の作図概念 - 基本の書き方 4. さまざまなグラフと使い方 - グラフの種類と使い方 - 主なグラフのサンプル - ヒストグラム - 棒グラフ - 箱ひげ図 - 散布図 - 折れ線グラフ
グラフの種類と使い方
主なグラフのサンプル fi ヒストグラム penguins̲hist <- ggplot(data = penguin̲plotdata, aes(x =
body̲mass̲g, ll = species)) + geom̲histogram(position = "identity", alpha = 0.8, binwidth = 50) plot(penguins̲hist)
主なグラフのサンプル fi 棒グラフ penguin̲bar <- ggplot(data = penguin̲plot, aes(x =
species, y = mean, ll = sex)) + geom̲bar(stat = "identity", position = "dodge") + geom̲errorbar(aes(ymin = mean - sd, ymax = mean + sd), position = position̲dodge(width = 0.9), width = 0.5) plot(penguin̲bar)
主なグラフのサンプル fi 箱ひげ図 penguin̲boxplot <- ggplot(data = penguin̲plotdata, aes(x =
species, y = body̲mass̲g, ll = sex)) + geom̲boxplot(position = "dodge") plot(penguin̲boxplot)
主なグラフのサンプル fl 散布図 penguin̲point <- ggplot(data = penguin̲plotdata, aes(x =
body̲mass̲g, y = ipper̲length̲mm)) + geom̲point(aes(color = species, shape = sex)) plot(penguin̲point)
主なグラフのサンプル 折れ線グラフ penguin̲line <- ggplot(data = penguin̲plot, aes(x = year,
y = mean)) + geom̲line(aes(colour = species, linetype = sex)) + geom̲errorbar(aes(ymin = mean - sd, ymax = mean + sd, colour = species), width = 0.01) plot(penguin̲line)
まとめ 可視化することで要約値だけでは分からないこと が見える • 間違った方法での可視化は有害 • ggplot2パッケージを使うと簡単に色々な作図が できる • いきなり機械学習ではなく
最初に可視化しよう
参考資料 ggplot2 cheatsheet https://raw.githubusercontent.com/ rstudio/cheatsheets/main/datavisualization.pdf • ・ggplot2による可視化入門 https://kazutan.github.io/fukuokaR11/ intro̲ggplot2.html