$30 off During Our Annual Pro Sale. View Details »

棒グラフ、帯グラフ(、円グラフ) / Bar chart, band chart (, pie...

棒グラフ、帯グラフ(、円グラフ) / Bar chart, band chart (, pie chart)

早稲田大学大学院経営管理研究科「企業データ分析」2024 冬のオンデマンド教材 第6回で使用したスライドです。

Kenji Saito

November 29, 2024
Tweet

More Decks by Kenji Saito

Other Decks in Technology

Transcript

  1. Boxes and whiskers — generated by Stable Diffusion XL v1.0

    2024 6 ( ) (WBS) 2024 6 ( ) — 2024-11 – p.1/23
  2. ( 20 ) 1 • 2 R • 3 •

    4 • 5 • 6 ( ) • 7 (1) 8 (2) 9 R ( ) (1) 10 R ( ) (2) 11 R ( ) (1) 12 R ( ) (2) 13 GPT-4 14 GPT-4 15 ( ) LaTeX Overleaf 8 (12/16 ) / (2 ) OK / 2024 6 ( ) — 2024-11 – p.3/23
  3. (bar chart) y ( ) cda-demo “ .R” Git “

    .R” 1 2024 6 ( ) — 2024-11 – p.5/23
  4. “ .txt” 1 1 <- read.table(" .txt", header=T) 10 barplot(

    1$ [1:10], names.arg=c(1:10), xlab=" ", ylab=" ", main=" 1 10 ") ‘barplot( . . . )’ : 2024 6 ( ) — 2024-11 – p.6/23
  5. 1 2 3 4 5 6 7 8 9 10

    ฟᖍ␒ྕ1ࠥ10ࡢⱥㄒࡢヨ㦂⤖ᯝ ฟᖍ␒ྕ ᚓⅬ 0 20 40 60 80 2024 6 ( ) — 2024-11 – p.7/23
  6. ( 10 ) 1 2 ## t(table) table ## (matrix)

    2 <- t( data.frame( = 1$ [1:10], = 1$ [1:10])) (‘beside=T’) barplot( , beside=T, names.arg=c(1:10), legend.text=T, ylim=c(0, 100), xlab=" ", ylab=" ", main=" 1 10 ") : 2024 6 ( ) — 2024-11 – p.8/23
  7. 1 2 3 4 5 6 7 8 9 10

    ⱥㄒ ᩘᏛ ฟᖍ␒ྕ1ࠥ10ࡢⱥㄒ࣭ᩘᏛࡢヨ㦂⤖ᯝ ฟᖍ␒ྕ ᚓⅬ 0 20 40 60 80 100 2024 6 ( ) — 2024-11 – p.9/23
  8. A∼D ( 100%) X Y data1 <- c( "A "=51,

    "B "=21, "C "=20, "D "=8) data2 <- c( "A "=33, "B "=35, "C "=20, "D "=12) data <- matrix(c(data1, data2), length(data1), 2) # 4 2 colnames(data) <- c("X ", "Y ") # 2024 6 ( ) — 2024-11 – p.11/23
  9. barplot(data, horiz=T, col=cm.colors(4), xlab=" (%)", legend.text=names(data1), main=" ") ‘horiz’ (

    F (False)) ‘col’ ‘cm.colors(4)’ cm ( ) 4 ‘legend.text=names(data1)’ data1 2024 6 ( ) — 2024-11 – p.12/23
  10. ## ## col ## density density <- c(50, 25, 13,

    7) barplot(data, beside=T, density=density, ylab=" (%)", legend.text=names(data1), main=" ") ‘density’ 2024 6 ( ) — 2024-11 – p.18/23