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="blue",
     main ="班上的統計與數學分數",
     xlab="統計分數",
     ylab="數學分數") 

hist(Statistic,
     col= "purple",
     main ="班上的統計分數",
     xlab ="統計分數",
     ylab ="人數") #直方圖

library(ggplot2)
data = data.frame(
  社團類型=c("休閒娛樂","知識閱讀","體育競技","科學創新","公益活動"),
  參加次數= c(185,82,36,28,25)
  ) 
ggplot(data, aes(x=社團類型,y=參加次數)) +
  geom_bar(stat="identity",width=.8,fill ="blue") #長條圖

data<- c(185,82,36,28,25)
labels <- c("休閒娛樂","知識閱讀","體育競技","科學創新","公益活動")
pie(data,labels,main ="參加社團比率", col=terrain.colors(length(data))) #圓餅圖

library(readr)
Data <-read_csv("C:/Users/user/Downloads/table1_1.csv")
## Rows: 10 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Name
## dbl (5): Statistic, Math, Japanese, Management, Accounting
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
print(Data)
## # A tibble: 10 × 6
##    Name   Statistic  Math Japanese Management Accounting
##    <chr>      <dbl> <dbl>    <dbl>      <dbl>      <dbl>
##  1 張青松        68    85       84         89         86
##  2 王奕翔        85    91       63         76         66
##  3 田新雨        74    74       61         80         69
##  4 徐麗娜        88   100       49         71         66
##  5 張志傑        63    82       89         78         80
##  6 趙穎睿        78    84       51         60         60
##  7 王智強        90    78       59         72         66
##  8 宋媛婷        80   100       53         73         70
##  9 袁四方        58    51       79         91         85
## 10 張建國        63    70       91         85         82
stem(Data$Japanese,scale = 2) #莖葉圖
## 
##   The decimal point is 1 digit(s) to the right of the |
## 
##   4 | 9
##   5 | 13
##   5 | 9
##   6 | 13
##   6 | 
##   7 | 
##   7 | 9
##   8 | 4
##   8 | 9
##   9 | 1
median(Data$Japanese)  #中位數
## [1] 62
as.numeric(names(table(Data$Japanese)))[which.max(table(Data$Japanese))]  #眾數數
## [1] 49
var(Data$Japanese) #變異數
## [1] 264.1
Q1 <- quantile(Data$Japanese, 1 / 4) #第一四分位數


Q3 <- quantile(Data$Japanese, 3 / 4) #第三四分位數