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

hist(s,freq = FALSE,
main = "統計直方圖",
xlab = "統計成績",ylab="次數")

# Load ggplot2
library(ggplot2)
# 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 , labels = c("娛樂休閒","知識閱讀","體育競技","科學創新","公益活動"))

# 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