#0524課堂作業ramen
load(file = "ramen.RData")
library(ggplot2)
## Warning: 套件 'ggplot2' 是用 R 版本 4.2.3 來建造的
#泡麵_包裝長Style條圖
s1 <- table(ramen$Style)
p.s1 <- proportions(s1)
p.s1 <- round(p.s1*100, 2)
p.s1
##
## Bowl Cup Pack Tray
## 24.98 14.41 53.94 6.66
ggplot(ramen, aes(x=Style, fill = Style))+
geom_bar()+
labs(x= "包裝", y= "數量", title = "ramen長條圖geom_bar", subtitle = "大華")

#泡麵_國Country家&包裝Style長條圖
ggplot(ramen, aes(x=Country, fill = Style))+
geom_bar()+
labs(x= "國家&包裝", y= "數量", title = "ramen長條圖geom_bar", subtitle = "大華")

#泡麵_盒狀圖
ggplot(ramen, aes(x = Style, y= Stars, fill= Style))+
geom_boxplot()+
labs(x= "包裝", y= "喜好", title = "ramene盒狀圖geom_boxplot", subtitle = "大華")
## Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).

#泡麵_直方圖
ggplot(ramen, aes(x = Stars, fill= Style))+
geom_histogram()+
labs(x= "喜好",y = "數量", title = "ramen直方圖geom_histogram", subtitle = "大華")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 2 rows containing non-finite values (`stat_bin()`).
