Statistic <- c(68,85,74,88,63,78,90,80,58,63)
Math <- c(85,91,74,100,82,84,78,100,51,70)
plot(Statistic,Math,
pch = 15,
col= "lightgreen",
main ="統計和數學分數",
xlab ="統計",
ylab ="數學")

hist(Math,
col= "lightblue",
main ="數學成績",
xlab ="分數",
ylab ="人數")

# Load ggplot2
library(ggplot2)
# Create data
data <- data.frame(
社團類型=c("1","2","3","4","5") ,
次數=c(25,28,36,82,185)
)
# Barplot
ggplot(data, aes(x=社團類型, y=次數),) +
geom_bar(stat = "identity", width=0.3,col="red")

data<- c(185,82,36,28,25)
labels <- c("娛樂休閒","知識閱讀","體育競技","科學創新","公益活動")
pie(data,labels,main ="喜愛社團比例",
border="black")
