library(ggplot2)
we <- c(68,85,74,88,63,78,90,80,58,63)
we2 <- c(85,91,74,100,82,84,78,100,51,70)
plot(we,we2,
     pch = 17,
     col= "darkgreen",
     main ="統計與數學成績散佈圖",
     xlab ="statistic 成績",
     ylab ="math 成績")

hist(we2,
     pch= 15,
     col= "lightblue",
     main ="數學成績分佈圖",
     xlab ="成績",
     ylab ="人數")

tmp <- data.frame(club=c("休閒娛樂","知識型","體育競技","科學創新","公益活動"),
          frequency=c(185,82,36,28,25))

ggplot(tmp, aes(x=club, y=frequency)) + 
    geom_bar(
        color="black",
        fill="pink",
        stat="identity"
        )

data<- c(185,82,36,28,25)
labels <- c("休閒娛樂","知識型","體育競技","科學創新","公益活動")

pie(data,labels,main ="大學生社團參與分佈圓餅圖", col=rainbow(length(data)),
    cex.main= 1.5)

df <- data.frame(club=c("休閒娛樂","知識型","體育競技","科學創新","公益活動"),
          frequency=c(185,82,36,28,25))
ggplot(df, aes(x=club, y=frequency)) +
  geom_segment( aes(x=club, xend=club, y=0, yend=frequency), color="black",size= 1) +
  geom_point( color="orange", size= 6) +
  xlab("社團類型") +
  ylab("次數")
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.