s<-c(68,85,74,88,63,78,94,80,58,63)
m<-c(85,91,74,100,82,84,78,100,51,70)
##畫圖
plot(s,m,
     pch=19,
     col="red")

hist(s,frep=FALSE,
     main="統計直方圖",
     xlab="統計成績",ylab="次數")
## Warning in plot.window(xlim, ylim, log, ...): "frep" is not a graphical
## parameter
## Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...): "frep"
## is not a graphical parameter
## Warning in axis(1, ...): "frep" is not a graphical parameter
## Warning in axis(2, at = yt, ...): "frep" is not a graphical parameter

#Load ggplot2
library(ggplot2)

#create data

#Create data
data <- data.frame(
  name=c("娛樂休閒","知識閱讀","體育競技","科學創新","公益活動"),
  value=c(185,82,36,28,25)
)

#Barplot
ggplot(data, aes(x=name, y=value)) +
  geom_bar(stat = "identity" , width=0.2)

# create Data
Prop <-c(185,82,36,28,25)

# Make the default Pie plot
pie(Prop , lanels = c ("娛樂休閒","知識閱讀","體育競技","科學創新","公益活動"))
## Warning in text.default(1.1 * P$x, 1.1 * P$y, labels[i], xpd = TRUE, adj =
## ifelse(P$x < : "lanels" is not a graphical parameter
## Warning in text.default(1.1 * P$x, 1.1 * P$y, labels[i], xpd = TRUE, adj =
## ifelse(P$x < : "lanels" is not a graphical parameter
## Warning in text.default(1.1 * P$x, 1.1 * P$y, labels[i], xpd = TRUE, adj =
## ifelse(P$x < : "lanels" is not a graphical parameter
## Warning in text.default(1.1 * P$x, 1.1 * P$y, labels[i], xpd = TRUE, adj =
## ifelse(P$x < : "lanels" is not a graphical parameter
## Warning in text.default(1.1 * P$x, 1.1 * P$y, labels[i], xpd = TRUE, adj =
## ifelse(P$x < : "lanels" is not a graphical parameter
## Warning in title(main = main, ...): "lanels" is not a graphical parameter

#Libraries
library(ggplot2)

# create data

#plot
ggplot(data, aes(x=name, y=value)) +
  geom_point()+
  geom_segment( aes(x=name, xend=name, y=0
                    , yend=value))

data2 <- read.csv("D:/table.csv")

#平均數 綜合除個數
mean(data2$Japanese)
## [1] 67.9
#中位數:將資料由小到大,位置居中者,中位數
median(data2$Japanese)
## [1] 62
#標準差 
sd(data2$Japanese)
## [1] 16.25115
#變異數
var(data2$Japanese)
## [1] 264.1
sd(data2$Japanese)
## [1] 16.25115
summary(data2)
##      Name             Statistic          Math          Japanese    
##  Length:10          Min.   :58.00   Min.   : 51.0   Min.   :49.00  
##  Class :character   1st Qu.:64.25   1st Qu.: 75.0   1st Qu.:54.50  
##  Mode  :character   Median :76.00   Median : 83.0   Median :62.00  
##                     Mean   :74.70   Mean   : 81.5   Mean   :67.90  
##                     3rd Qu.:83.75   3rd Qu.: 89.5   3rd Qu.:82.75  
##                     Max.   :90.00   Max.   :100.0   Max.   :91.00  
##    Management      Accounting  
##  Min.   :60.00   Min.   :60.0  
##  1st Qu.:72.25   1st Qu.:66.0  
##  Median :77.00   Median :69.5  
##  Mean   :77.50   Mean   :73.0  
##  3rd Qu.:83.75   3rd Qu.:81.5  
##  Max.   :91.00   Max.   :86.0