Slide 1

Slide 1 text

2022-08-28@ 統 計 思 考 院 探 索 的 解 析 再 現 可 能 研 究 ⽠ ⽣ 真 也 徳 島 ⼤ 学 デ ザ イ ン 型 AI 教 育 研 究 セ ン タ

Slide 2

Slide 2 text

⾃⼰紹介 (Uryu Shinya) u_ribo AI 2021 10 uribo 2

Slide 3

Slide 3 text

Showcase IUUQTHJUIVCDPNVSJCP%BZ.BQ$IBMMFOHF IUUQTHJUIVCDPNVSJCPVSCBOTQBDFNBQ IUUQTHJUIVCDPNVSJCPWPMDBOP IUUQTHJUIVCDPNVSJCPTIPXZPVSTUSJQFT IUUQTHJTUHJUIVCDPNVSJCPCCDEFCFCBBDC IUUQTHJTUHJUIVCDPNVSJCPGFCFGDFEEBCEFEG IUUQTHJTUHJUIVCDPNVSJCPEEBDBGBFDEGCE

Slide 4

Slide 4 text

IUUQTXXXLTQVCDPKQCPPLEFUBJMIUNM 分析 可視化⼊⾨ (2021). Kieran Healy Data Visualization: A practical introduction ( 2 019 ). Princeton University Press. 4

Slide 5

Slide 5 text

品書 1. 総 3. ggplot 2 2. 3 5 ৮Εͳ͍಺༰

Slide 6

Slide 6 text

対象 ⼈ R ggplot 2 6 R

Slide 7

Slide 7 text

前置 7 {ggplot 2 } GitHub {magrittr} %>% R 4 . 1 . 0 |> び R 4 . 2 . 1 Speaker Deck 01 # σʔλૢ࡞ͷͨΊͷύοέʔδ 02 library(dplyr, warn.conflicts = FALSE) 03 penguins_xy < - 04 palmerpenguins : : penguins | > 05 select(flipper_length_mm, bill_length_mm, species) | > 06 f i lter(!is.na(flipper_length_mm))

Slide 8

Slide 8 text

前置 8 
 01 packages < - c( 02 "tidyverse", "sf", "zipangu", "tabularmaps", "geofacet", 03 "palmerpenguins", "datasauRus", "gt", "gapminder", "statebins", 04 "ggtext", "ggrepel", "gghighlight", "patchwork", 05 "rnaturalearth", "ggokabeito") 06 install.packages(setdiff(packages, rownames(installed.packages()))) 07 08 ropensci_pkgs < - c("rnaturalearthhires") 09 install.packages(setdiff(ropensci_pkgs, rownames(installed.packages())), 10 repos = "https: / / ropensci.r - universe.dev") 11 12 wilkelab_pkgs < - c("gridtext") 13 install.packages(setdiff(wilkelab_pkgs, rownames(installed.packages())), 14 repos = "https: / / wilkelab.r - universe.dev") 15 16 uris_pkgs < - c("ssdse") 17 install.packages(setdiff(uris_pkgs, rownames(installed.packages())), 18 repos = "https: / / uribo.r - universe.dev")

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

࣮ࡏ ৘ใ : : #609527 : : 29.3cm : 1 実在 情報、 変換 過程 情報量 損失 ⽣ 写像・ ・可視化 σʔλ   mapping #020202 10

Slide 11

Slide 11 text

࣮ࡏ ৘ใ 情報 含 上 写像 写像・ ・可視化 ՄࢹԽ σʔλ mapping x y x y etc. 11

Slide 12

Slide 12 text

実在 情報、可視化 写像 失 情報量 補 写像・ ・可視化 12 良 悪 ⼀ 観点: 読 取 情報 性質

Slide 13

Slide 13 text

可視化 重要性 実在 情報 効率的 伝 ⽅法 必要 σʔλՄࢹԽҎ֎ͷख๏ͷྫ 13

Slide 14

Slide 14 text

可視化 重要性 例: 可視化 重要性 説明 例 総 x,y 総 14

Slide 15

Slide 15 text

可視化 重要性 Alberto Cairo, 2 0 1 6 : 15

Slide 16

Slide 16 text

法則 基 情報 理解 16 ۙ઀ ྨࣅ ғ͍ࠐΈ ด࠯ ࿈ଓੑ ઀ଓ 視覚的情報 基 、要素間 関係性 推論

Slide 17

Slide 17 text

統計 歴史 17 ग़య൧ౢوࢠ σʔλࢹ֮Խͷਓྨ࢙άϥϑͷൃ໌͔Β࣌ؒͱۭؒͷՄࢹԽ·Ͱ੨౔ࣾ

Slide 18

Slide 18 text

近代的 発明者 ・ 18 8JMMJBN1MBZGBJS 1VCMJDEPNBJO WJB8JLJNFEJB$PNNPOT IUUQTVQMPBEXJLJNFEJBPSHXJLJQFEJBDPNNPOT1MBZGBJS@5JNF4FSJFTQOH 18 総 
 1786 The Commercial and Political Atlas, 1 7 86 Statistical Breviary, 1 80 1

Slide 19

Slide 19 text

1 . 2 . 総 肢 3 . 18

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

{ggplot2} The Grammar of Graphics (Wilkinson, 20 05 ) R The Grammar of Graphics 21

Slide 22

Slide 22 text

可視化、ggplot2 推 理由 22

Slide 23

Slide 23 text

base 23 縛 IUUQTHJUIVCDPN1PJTPO"MJFOCBTFHSBQIJDT

Slide 24

Slide 24 text

ggplot2 構成 3 柱 1. 2. 3. 24

Slide 25

Slide 25 text

ggplot2 利⽤可能 01 # install.packages("ggplot2") 02 # ggplot2ύοέʔδͷಡΈࠐΈ 03 # ൃදࢿྉͰ͸2022೥8݄࣌఺ͰͷCRAN࠷৽όʔδϣϯͰ͋Δ3.3.6Λར༻͠·͢ 04 library(ggplot2) 05 06 # tidyverseύοέʔδʹ಺แ͞Ε͍ͯΔͨΊɺͪ͜ΒΛಡΈࠐΜͰ΋OKͰ͢ 07 # install.packages("tidyverse") 08 # library(tidyverse) 25

Slide 26

Slide 26 text

Tidyverse 26 ಡΈࠐΈ ੔ܗ Ճ޻ ՄࢹԽ Ϟσϧ ఻ୡ Garrett and Hadley (2016) 


Slide 27

Slide 27 text

ggplot2 第⼀歩 fl ipper_length_mm bill_length_mm species 181 39.1 Adelie 186 39.5 Adelie 195 40.3 Adelie … … … 198 50.2 Chinstrap 27 01 # σʔλૢ࡞ͷͨΊͷύοέʔδ 02 library(dplyr, warn.conflicts = FALSE) 03 penguins_xy < - 04 palmerpenguins : : penguins | > 05 select(flipper_length_mm, bill_length_mm, species) | > 06 f i lter(!is.na(flipper_length_mm))

Slide 28

Slide 28 text

ggplot2 第⼀歩 01 ggplot(data = penguins_xy) テ data.frame data penguins_xy 28

Slide 29

Slide 29 text

01 ggplot(data = penguins_xy) 02 aes(x = flipper_length_mm, 03 y = bill_length_mm) ggplot2 第⼀歩 デ x y 
 + + 
 29 data penguins_xy 
 x fl ipper_length_mm 
 y bill_length_mm

Slide 30

Slide 30 text

01 ggplot(data = penguins_xy) +

Slide 31

Slide 31 text

審美的 (aesthetic) 要素 x fl ipper_length_mm y bill_length_mm 
 species 31 01 ggplot(data = penguins_xy) +

Slide 32

Slide 32 text

審美的 (aesthetic) 要素 aes(άϥϑͷதͷ໾ׂ = ม਺) x, y color, fi ll size shape, linetype alpha group 32 linewidth* linewidth v 3 . 4 . 0

Slide 33

Slide 33 text

審美的 (aesthetic) 要素 33 審美的要素 機能 値 対応

Slide 34

Slide 34 text

審美的要素 指定⽅法 34 01 # 1. aes()͸ϨΠϠͱͯ͠ggplotΦϒδΣΫτʹ௥Ճͯ͠΋ྑ͍ 02 ggplot(data = penguins_xy) + 03 aes(x = flipper_length_mm, 04 y = bill_length_mm) 05 06 # 2. ggplot(mapping = aes(...))ͱͯ͠༩͑ͯ΋ྑ͍ 07 ggplot(data = penguins_xy, 08 mapping = aes(x = flipper_length_mm, 09 y = bill_length_mm)) 10 11 # 3. ggplot(data = ,mapping = aes(x = ,y = ))͸҉໧తʹҾ਺Λলུͯ͠هड़Ͱ͖Δ 12 ggplot(penguins_xy, 13 aes(flipper_length_mm, bill_length_mm))

Slide 35

Slide 35 text

審美的要素 指定⽅法 35 共通 内 04 color = species, 05 group = species aes(color = species) aes(group = species) (species) 
 01 ggplot(data = penguins_xy) +

Slide 36

Slide 36 text

⼈⼝ 可視化 01 dplyr : : glimpse(df_ssdse_b) 02 #> Rows: 564 03 #> Columns: 7 04 #> $ prefecture "๺ւಓ", "๺ւಓ", "๺ւಓ", "๺ւಓ", … 05 #> $ year 2019, 2018, 2017, 2016, 2015, 2014, 2013, … 06 #> $ population 5250000, 5286000, 5320000, 5352000, 5381733, … 07 #> $ birth_male 15988, 16681, 17503, 17888, 18838, 19010, … 08 #> $ birth_female 15032, 15961, 16537, 17237, 17857, 18048, … 09 #> $ spending 294682, 281054, 286698, 287325, 272124, … 10 #> $ food_expenses 72912, 69044, 69640, 69445, 65912, 65450, … 11 12 df_ssdse_b2019 < - 13 df_ssdse_b | > 14 f i lter(year = = 2019) 符 符 36 統計 提供 教育⽤標準 (SSDSE-B) 加⼯ IUUQTXXXOTUBDHPKQVTFMJUFSBDZTTETF

Slide 37

Slide 37 text

⼈⼝ 可視化 37 01 df_ssdse_b2019 | > 02 ggplot() + 03 aes(prefecture, population) + 04 geom_bar(stat = "identity") x

Slide 38

Slide 38 text

⼈⼝ 可視化 38 01 df_ssdse_b2019 06 coord_flip()

Slide 39

Slide 39 text

⼈⼝ 可視化 39 02 # ͓͓ΑͦͷҢ౓ͷॱ൪ʹ഑ஔ͢Δ 03 mutate(prefecture = 04 forcats : : fct_rev( 05 forcats : : fct_inorder( 06 prefecture))) | > 01 df_ssdse_b2019

Slide 40

Slide 40 text

ggplot2 提供 関数群 ggplot(data = ) aes() geom_*() 40 ggplot

Slide 41

Slide 41 text

ggplot2 提供 関数群 stat_*() scale_*() coord_*() facet_*() theme(),theme_*() 41 ggplot(data = ) aes() geom_*() ggplot

Slide 42

Slide 42 text

: geom_*() 種類、描画 対象 定義 42 geom_density() geom_sf() geom_smooth() geom_point() geom_line() geom_bar() geom_histogram() geom_boxplot()

Slide 43

Slide 43 text

種類、描画 対象 定義 43 geom_bar(stat = "identity") df_ssdse_b2019

Slide 44

Slide 44 text

統計処理 44 stat = "identity" ? geom_bar #> function (mapping = NULL, data = NULL, stat = "count", position = "stack", #> . . . , width = NULL, na.rm = FALSE, orientation = NA, show.legend = NA, #> inherit.aes = TRUE) geom_bar(stat = "count") 01 df_ssdse_b2019 | > 02 f i lter_shikoku() | > 03 ggplot() + 04 aes(prefecture, population) + 05 geom_bar(stat = "identity")

Slide 45

Slide 45 text

統計処理 : stat_*() 上 変形・集計 ⾏ 45 stat = "count" ... aes(x = ) y 01 tibble : : tibble( 02 group = c(rep("a", 4), rep("b", 2), "c") 03 ) | > 04 ggplot() + 05 aes(x = group) + 06 geom_bar(stat = "count") 01 df_ssdse_b2019 | > 02 f i lter_shikoku() | > 03 ggplot() + 04 aes(prefecture, population) + 05 geom_bar(stat = "identity") stat = "identity" ... aes(y = ) stat_count() group

Slide 46

Slide 46 text

統計処理 : stat_*() geom_*(stat = ) or stat_*() 利⽤ 46 01 p < - 02 df_ssdse_b2019 | > 03 ggplot() + 04 aes(x = spending) p + geom_bar(stat = "bin", bins = 10) p + geom_histogram(bins = 10) p + stat_bin(bins = 10)

Slide 47

Slide 47 text

x 47 変数 属性 審美的要素

Slide 48

Slide 48 text

: scale__*() 48 01 df_ssdse_b | > 02 f i lter_shikoku() | > 03 ggplot() + 04 aes(year, population, 05 group = prefecture, 06 color = prefecture) + 07 geom_line()

Slide 49

Slide 49 text

: scale__*() 49 01 df_ssdse_b 08 scale_x_continuous( 09 breaks = seq.int(2008, 2019, by = 2)) + 10 scale_y_log10() + 11 scale_color_viridis_d() x y

Slide 50

Slide 50 text

座標系 50 値 配置 決 2 ggplot 2 x y x y 
 ) x 3 
 y 10 (0,10, 20,...)

Slide 51

Slide 51 text

座標系: coord_*() 51 p < - ggplot(data = penguins_xy) + aes(x = flipper_length_mm, y = bill_length_mm) + geom_point() p + coord_flip() x y x y p + coord_f i xed(ratio = 1)

Slide 52

Slide 52 text

52 任意 変数 基 分割、 形式 表⽰ 'SBODJT"8BMLFS 1VCMJDEPNBJO WJB8JLJNFEJB$PNNPOT IUUQTVQMPBEXJLJNFEJBPSHXJLJQFEJBDPNNPOTG1FSTPOT@8JUI@(BJOGVM@0DDVQBUJPOT@BOE@"UUFOEJOH@4DIPPM@JO@KQH 9 (1874)

Slide 53

Slide 53 text

: facet_*() 53 01 p < - 02 df_ssdse_b | > 03 f i lter_shikoku() | > 04 select(year, prefecture, starts_with("birth")) | > 05 tidyr : : pivot_longer(cols = starts_with("birth"), 06 names_to = "gender", 07 values_to = "value", 08 names_pref i x = "birth_") | > 09 ggplot() + 10 aes(year, value) + 11 geom_line(aes(group = prefecture, color = prefecture)) + 12 scale_x_continuous(breaks = seq.int(2008, 2019, by = 2)) + 13 scale_color_manual(values = custom_pals[1 : 4]) 14 15 p$data

Slide 54

Slide 54 text

: facet_*() 54 p_facet < - p + facet_wrap(~ gender, scales = "free_y", ncol = 2) p + facet_grid(rows = vars(gender), scales = "free_y")

Slide 55

Slide 55 text

: theme(), theme_*() 55 ggplot2 豊富 存在

Slide 56

Slide 56 text

: theme(), theme_*() 56 01 p_facet + 02 theme_classic() + 03 theme( 04 strip.background = element_rect(f i ll = "gray"), 05 strip.text = element_text(color = "white", 06 face = "bold"), 07 legend.position = "top", 08 axis.title = element_text(color = "#28a87d"), 09 axis.text = element_text(color = "#28a87d"), 10 axis.ticks = element_line(color = "#28a87d")) 細 部位 theme()、element_*() 制御 element_blank() element_rect() element_line() element_text()

Slide 57

Slide 57 text

{ggtext} ⽂字 装飾 57 01 library(palmerpenguins) 02 p_penguins_scatter < - 03 penguins | > 04 ggplot() + 05 aes(flipper_length_mm, bill_length_mm) + 06 geom_point(aes(color = species), 07 alpha = 0.5, 08 show.legend = FALSE) + 09 geom_smooth(method = "lm", 10 aes(group = species), 11 se = FALSE, 12 color = "#0E0E0E") + 13 scale_color_manual(values = custom_pals) + 14 theme_light() + 15 labs(title = "ϖϯΪϯͷମͷେ͖͞ͷؔ܎", 16 x = "ཌྷͷ௕͞(mm)", 17 y = "ͪ͘͹͠ͷ௕͞(mm)")

Slide 58

Slide 58 text

{ggtext} ⽂字 装飾 58 01 library(ggtext) 03 labs(title = " * * ϖϯΪϯͷମͷେ͖͞ͷؔ܎ * * ", 04 x = "*F l ipper length * (mm)", 05 y = "*Bill length * (mm)") + 06 theme( 07 plot.title = ggtext : : element_markdown( 08 color = custom_pals[4], 09 f i ll = "gray80" 10 ), 11 axis.title.x = element_markdown(), 12 axis.title.y = element_markdown()) 02 p_penguins_scatter + Markdown

Slide 59

Slide 59 text

{gghighlight} 使 強調 59 02 p_penguins_scatter + 03 gghighlight(species = = "Adelie")

Slide 60

Slide 60 text

対 注釈 {ggrepel} 追加 60 01 library(ggrepel) 02 p_gapminder < - 03 gapminder : : gapminder | > 04 f i lter(year = = 2007, 05 continent = = "Americas") | > 06 ggplot() + 07 aes(gdpPercap, lifeExp) + 08 geom_point()

Slide 61

Slide 61 text

対 注釈 {ggrepel} 追加 61 01 p_gapminder + 02 ggrepel : : geom_text_repel( 03ɹ aes(label = country))

Slide 62

Slide 62 text

{ggrepel} {gghighlight} 合 技 62 01 p_gapminder + : : gghighlight( 03 lifeExp < 70) +

Slide 63

Slide 63 text

1 . {ggplot 2 } R 2 . 3 . {ggplot 2 }

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

地図表現 過程 65 空間 他 定量的 紐付 、地図上 表⽰ ஍ཧۭؒ৘ใ σʔλ ओ୊ਤ + etc.

Slide 66

Slide 66 text

階級区分図 誕⽣ 66 $IBSMFT%VQJO 1VCMJDEPNBJO WJB8JLJNFEJB$PNNPOT IUUQTDPNNPOTXJLJNFEJBPSHXJLJ'JMF$BSUF@ fi HVSBUJWF@EF@MJOTUSVDUJPO@QPQVMBJSF@EF@MB@'SBODFKQH 1826 1 
 
 18 19 


Slide 67

Slide 67 text

01 ne_jpn 02 #> Simple feature collection with 47 features and 3 f i elds 03 #> Geometry type: MULTIPOLYGON 04 #> Dimension: XY 05 #> Bounding box: xmin: 122.9382 ymin: 24.2121 xmax: 153.9856 ymax: 45.52041 06 #> CRS : + proj=longlat + datum=WGS84 + no_defs + ellps=WGS84 + towgs84=0,0,0 07 #> First 10 features: 08 #> iso_3166_2 prefecture region geometry 09 #> 1 01 ๺ւಓ Hokkaido MULTIPOLYGON (((143.8965 44 . . . 10 #> 2 02 ੨৿ݝ Tohoku MULTIPOLYGON (((139.9438 40 . . . 11 #> 3 03 ؠखݝ Tohoku MULTIPOLYGON (((141.681 40.... 12 #> 4 04 ٶ৓ݝ Tohoku MULTIPOLYGON (((141.6403 38 . . . 13 #> 5 05 ळాݝ Tohoku MULTIPOLYGON (((139.8809 39 . . . 地図 作 67 地理空間情報 拡張可能 {sf} 便利 sf sfg(geometry) sfc (column) sf 3 Natural Earth {rnaturalearth}

Slide 68

Slide 68 text

地図 作 68 01 ne_jpn | > 02 ggplot() + 03 aes() + 04 geom_sf()

Slide 69

Slide 69 text

地図 作 69 01 ne_jpn | > 02 ggplot() + 03 aes(f i ll = prefecture) + 04 geom_sf(show.legend = FALSE)

Slide 70

Slide 70 text

地理空間情報 facet 70

Slide 71

Slide 71 text

地理空間情報 facet 71 01 sf_jpn_population | > 02 f i lter(prefecture %in% c("ಙౡݝ", "߳઒ݝ", "Ѫඤݝ", "ߴ஌ݝ")) | > 03 ggplot() + 04 aes(f i ll = population) + 05 geom_sf(color = "transparent") + 06 guides(f i ll = guide_colorbar(title = "૯ਓޱ")) + 07 scico : : scale_f i ll_scico(palette = "imola", 08 labels = zipangu : : label_kansuji(), 09 breaks = c(700000, 1000000, 1400000)) + 10 labs(title = "࢛ࠃ4ݝͷਓޱ", 11 subtitle = "2008೥͔Β2019೥ͷਪҠ", 12 caption = "Source: ౷ܭηϯλʔ ڭҭ༻ඪ४σʔληοτ\nSSDSE-ݝผਪҠʢSSDSE-Bʣ") + 13 theme_void() + 14 theme(legend.position = "top", 15 legend.key.width = unit(3.0, "line")) + 16 facet_wrap(~ year, nrow = 2)

Slide 72

Slide 72 text

地図表現 ⾏ 際 遭遇 課題 72 2. 1. 3. 4.

Slide 73

Slide 73 text

地球(3次元) 平⾯(2次元) 表現 ? 73 球体 平⾯ 表現 過程 歪 ⽣ → 地図 嘘

Slide 74

Slide 74 text

座標参照系(Coordinate Reference System: CRS) 74 空間 座標 地球上 位置 特定 仕組 ஍ཧ࠲ඪܥ ౤Ө࠲ඪܥ 
 
 2 XY UTM

Slide 75

Slide 75 text

地図投影法 変換 75 01 # Natural Earth͔ΒશٿϙϦΰϯΛऔಘ 02 ne_world < - 03 rnaturalearth : : ne_countries(scale = 10, 04 returnclass = "sf") 05 06 p < - 07 ne_world | > 08 ggplot() + 09 geom_sf() sf

Slide 76

Slide 76 text

地図投影法 変換 76 1 . coord_sf() 2. CRS 01 # ϞϧϫΠσਤ๏ʹΑΔੈք஍ਤͷඳը 02 p + 03 coord_sf(crs = " + proj=moll") 01 # st_transform()ʹΑΔ࠲ඪࢀরܥͷมߋ 02 ne_world_moll < - 03 sf : : st_transform(ne_world, crs = " + proj=moll") 04 05 ggplot(data = ne_world_moll) + 06 geom_sf()

Slide 77

Slide 77 text

地理空間 属性 紐付 77 prefecture geometry Hokkaido POLYGON(…) Aomori-ken POLYGON(…) … … Okinawa-ken POLYGON(…) prefecture population ๺ւಓ 5.281 ੨৿ݝ 1.249 … … ԭೄݝ 1.457 distinct geometry Hokkaido POLYGON(…) Honsyu POLYGON(…) … … Kyusyu POLYGON(…) prefecture geometry ๺ւಓ POLYGON(…) ੨৿ݝ POLYGON(…) … … ԭೄݝ POLYGON(…) × × ✓ + NG NG 
 = prefecture population geometry ๺ւಓ 5.281 POLYGON(…) ੨৿ݝ 1.249 POLYGON(…) … … … ԭೄݝ 1.457 POLYGON(…)

Slide 78

Slide 78 text

必要 応 名寄 集計単位 変更 78 01 ne_jpn_region < - 02 ne_jpn | > 03 group_by(region) | > 04 summarise() 01 ne_jpn_region | > 02 left_join(df_region_pops_2019, 03 by = "region") | > 04 ggplot() + 05 aes(f i ll = population) + 06 geom_sf(color = "transparent") geometry

Slide 79

Slide 79 text

地図 使 表現 79 IUUQTXXXTUPQDPWJEKQ 空間的 位置関係 ⼤ 保持 形式 表現 ΧϥϜ஍ਤ ※⾒ ⼈ 対 、空間的 配置 対 理解 暗黙的 求 {statebins}

Slide 80

Slide 80 text

01 library(tabularmaps) 02 jpn77 | > 03 select(jis_code, 04 prefecture = prefecture_kanji, 05 x, 06 y) | > 07 left_join(df_ssdse_b2019, 08 by = "prefecture") | > 09 tabularmap(x, 10 y, 11 group = jis_code, 12 label = prefecture, 13 f i ll = population, 14 size = 3) + 15 scale_f i ll_viridis_c() + 16 theme_tabularmap() {tabularmaps} 80

Slide 81

Slide 81 text

{geofacet} 81 01 library(geofacet) 02 jp_prefs_grid1 < - 03 jp_prefs_grid1 | > 04 left_join( 05 zipangu : : jpnprefs | > 06 select(jis_code, prefecture = prefecture_kanji), 07 by = c("code_pref_jis" = "jis_code")) 01 p < - 02 df_ssdse_b | > 03 ggplot() + 04 aes(year, population) + 05 geom_line() + 06 theme_gray(base_size = 6) 07 08 p + 09 facet_geo(~ prefecture, 10 grid = "jp_prefs_grid1", 11 scales = "free_y")

Slide 82

Slide 82 text

1 . R {sf} 2 . {sf} ggplot 2 ::geom_sf() 3 . 4 . 総

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

利⽤ 84 IUUQTXXXSTUVEJPDPNSFTPVSDFTDIFBUTIFFUT ggplot 2 dplyr

Slide 85

Slide 85 text

多 図・ ⾒ TidyTuesday 85 # 30 DayMapChallenge > A weekly social data project in R. IUUQTHJUIVCDPNSGPSEBUBTDJFODFUJEZUVFTEBZ from Data to Vis Twitter #tidytuesday R Python D 3 .js THE R GRAPH GALLERY IUUQTSHSBQIHBMMFSZDPN IUUQTXXXEBUBUPWJ[DPN awesome-ggplot2 IUUQTHJUIVCDPNFSJLHBIOFSBXFTPNFHHQMPU ggplot 2 ggplot2 extensions IUUQTFYUTHHQMPUUJEZWFSTFPSH ggplot 2 #rtistry

Slide 86

Slide 86 text

最後 〜今回 発表 伝 〜 1 . 2 . 3.

Slide 87

Slide 87 text

参考⽂献・URL 87 Kieran Healy, 2019. Data Visualization: A practical introduction. Princeton University Press (⽠⽣真也、江⼝哲史、三村喬⽣ 訳, 2021. 分析 可視化⼊⾨. 講談社 ) Claus Wilke, 2019. Fundamentals of Data Visualization: A Primer on Making Informative and Compelling Figures. OʼReilly (⼩林儀匡、瀬⼾⼭雅⼈訳, 2022. 基礎: 明確 、魅⼒的 、説得⼒ ⾒ ⽅・伝 ⽅. ・ ) Michael Friendly and Howard Wainer, 2021. A History of Data Visualization and Graphic Communication. Harvard University Press (飯嶋貴⼦訳, 2021. 視覚化 ⼈類史: 発明 時間 空間 可視化 . ⻘⼟社) Jonathan Schwabish, 2021. Better Data Visualizations: A Guide for Scholars, Researchers, and Wonks Fundamentals of Data Visualization. Columbia University Press Hadley Wickham, Danielle Navarro, and Thomas Lin Pedersen, (2022). ggplot2: elegant graphics for data analysis. Springer Cédric Scherer 2022. Graphic Design with ggplot2: How to Create Engaging and Complex Visualizations in R IUUQTDMBVTXJMLFDPNEBUBWJ[ IUUQTGSJFOEMZHJUIVCJP)JTU%BUB7JT IUUQTHHQMPUCPPLPSH IUUQTTPDWJ[DP IUUQTSTUVEJPDPOGHJUIVCJPHHQMPUHSBQIJDEFTJHO

Slide 88

Slide 88 text

ENJOY!