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 = 19,
col = "red")

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 = 19,
col = "red")

hist(statistic,
freq = TRUE,
main = "統計成績直方圖",
xlab = "統計成績")

# Load ggplot2
library(ggplot2)
# Create data
data <- data.frame(
name=c("娛樂休閒","知識閱讀","體育競技","科學創新","公益活動") ,
value=c(5,4,3,2,1)
)
# Barplot
ggplot(data, aes(x=name, y=value)) +
geom_bar(stat = "identity", width=0.2)

# Load ggplot2
library(ggplot2)
# Create data
data <- data.frame(
name=c("娛樂休閒","知識閱讀","體育競技","科學創新","公益活動") ,
value=c(5,4,3,2,1)
)
# Create Data
Prop <- c(5,4,3,2,1)
# Make the default Pie Plot
pie(Prop)

# Load ggplot2
library(ggplot2)
# Create data
data <- data.frame(
name=c("娛樂休閒","知識閱讀","體育競技","科學創新","公益活動") ,
value=c(5,4,3,2,1)
)
# Libraries
library(ggplot2)
# Create data
data <- data.frame(x=seq(1,30), y=abs(rnorm(30)))
# Plot
ggplot(data, aes(x=x, y=y)) +
geom_point() +
geom_segment( aes(x=x, xend=x, y=0, yend=y))
