weight <- c(55,78,56,87,25,52)
high <- c(158,163,165,168,175,178)
money <- c(6000,4500,8421,1264)
plot(weight,high,
pch=17,
col="orange",
xlab="體重",
ylab="身高",
main="班級的身高體重")
library(ggplot2)
data <- data.frame(
name=c("王曉明","B","C","D","E","F") ,
value=c(50,55,63,55,67,43)
)
# Barplot
ggplot(data, aes(x=name, y=value)) +
geom_bar(stat = "identity", width=0.2, fill="skyblue")
hist(weight,
col= "lightyellow",
main ="班上的體重與身高",
xlab ="體重",
ylab ="次數")