# Load ggplot2
library(ggplot2)
# Create data
data <- data.frame(
cat=c("A","B","C","D","E") ,
fre=c(3,12,5,18,45)
)
# Barplot
ggplot(data, aes(x=cat, y=fre)) +
geom_bar(stat = "identity", width=0.2,fill="purple")

# Get the library.
library("plotrix")
# Create data for the graph.
x <- c(21, 62, 10,53)
lbl <- c("70後", "80後", "90後", "00後")
# Plot the chart.
pie3D(x,labels = lbl,explode = 0.2, main = "出生年齡段 - 餅狀圖")

# plot
ggplot(data, aes(x=cat, y=fre)) +
geom_segment( aes(x=cat, xend=cat, y=0, yend=fre)) +
geom_point( size=5, color="gray", fill=alpha("pink", 0.3), alpha=0.8, shape=21, stroke=3)

we <- c(155,160,170,175,175,255,289)
hist(we,
col= "lightyellow",
main ="每個人的時薪",
xlab ="時薪",
ylab ="人數")

stem(we)
##
## The decimal point is 2 digit(s) to the right of the |
##
## 1 | 66788
## 2 |
## 2 | 69