we <- c(68,85,74,88,63,78,90,80,58,63)

we2 <- c(85,91,74,100,82,84,78,100,51,70)

mean(we)
## [1] 74.7
median(we)
## [1] 76
min(we)
## [1] 58
max(we)
## [1] 90
as.numeric(names(table(we)))[which.max(table(we))] 
## [1] 63
sd(we)
## [1] 11.32402
var(we)
## [1] 128.2333
plot(we,we2,
     pch = 17,
     col= "blue",
main ="班上的成績統計",
     xlab ="統計成績",
     ylab ="數學成績")

# Libraries
library(ggplot2)

data <- data.frame(
  統計成績=c("A","B","C","D","E","F","G","H","I","J") ,  
  分數=c(68,85,74,88,63,78,90,80,58,63)
  )

# Barplot
ggplot(data, aes(x=統計成績, y=分數)) + 
  geom_bar(stat = "identity")

# Load ggplot2
library(ggplot2)
# Load ggplot2
library(ggplot2)

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

# Barplot
ggplot(data, aes(x=社團類型, y=次數)) + 
  geom_bar(stat = "identity", width=0.2,  fill="skyblue") 

# Create data for the graph.
x <- c(25,28,36,82,185)
labels <- c("公益活動","科學創新","體育競技","知識閱讀","娛樂休閒")
# Plot the chart.
pie(x,labels)

# Libraries
library(ggplot2)

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

# Plot
ggplot(data, aes(x=x, y=y)) +
  geom_segment( aes(x=x, xend=x, y=0, yend=y), color="red") +
  geom_point( color="orange", size=4) +
  theme_light() +
  theme(
    panel.grid.major.x = element_blank(),
    panel.border = element_blank(),
    axis.ticks.x = element_blank()
  ) +
  xlab("社團類型") +
  ylab("次數")

Data<- read.csv("D:/table1_1.csv")
stem(Data$Japanese)
## 
##   The decimal point is 1 digit(s) to the right of the |
## 
##   4 | 9
##   5 | 139
##   6 | 13
##   7 | 9
##   8 | 49
##   9 | 1
Data<- read.csv("D:/table1_1.csv")
mean(Data$Japanese)
## [1] 67.9
median(Data$Japanese)
## [1] 62
as.numeric(names(table(Data$Japanese)))[which.max(table(Data$Japanese))]
## [1] 49
sd(Data$Japanese)
## [1] 16.25115
var(Data$Japanese)
## [1] 264.1
quantile(Data$Japanese, 1/4)
##  25% 
## 54.5
quantile(Data$Japanese, 3/4)
##   75% 
## 82.75