*disclaimer
1196853
balloonplot
- 頻度を風船の大きさで表現
balloonplot
library(gplots)
balloonplot(x軸の項目, y軸の項目, 頻度)
- データ例
ID: Year:学年3レベル name:項目名 value:値
balloonplot(df$name, df$Year, df$value)
- オプション
- xlab="x軸名"
- dotcolor="skyblue",
- show.zeros=FALSE,
- main
- タイトル表示
- label.size,
- cum.margins
- 余白のグレー
- label.lines
- text.size,
- show.margins
- colsrt=66
- 列の項目名を66度傾ける
例
具体例
- table()で集計しておいて、それをグラフ化する
str(month.dat3) 'data.frame': 3648 obs. of 8 variables: $ Months: num 7 9 11 13 16 7 9 11 13 16 ... $ Year : Factor w/ 2 levels "1st","2nd": 1 1 1 1 1 1 1 1 1 1 ... $ topic : Factor w/ 5 levels "eigo","homeru",..: 3 1 4 5 2 3 1 4 5 2 ... $ SubjID: Factor w/ 40 levels "G1_01","G1_02",..: 1 1 1 1 1 1 1 1 1 1 ... $ mdd : num 1.5 2.33 2.17 1.67 2.38 ... $ mhd : num 1 2 1.67 1.33 2.12 ... $ KJ : num 0.667 1.846 1.429 1 1.889 ... $ SL : num 3 13 7 4 9 3 3 9 5 8 ... tab <- table(month.dat3$Months, month.dat3$Year) balloonplot(tab)
Reference
https://rpubs.com/yoshio/97567
ggpubr
https://rpkgs.datanovia.com/ggpubr/reference/ggballoonplot.html
https://sugiura-ken.org/wiki/