names <- c("田所浩二","远野","德川","我修院","比利♂王","Van","木吉Kazuya","魔♂男")
length <- c(11,14,19,19,98,81,45,51)
philosophy_coefficients <- c(25,25,15,15,100,95,98,95)
coushudeshuju <- c(1,2,3,4,5,6,7,8)
yirancoushu <- c(11,4,5,14,19,19,8,10)
zuizhongcoushu <- c(1,1,2,3,5,8,13,21)
info <- data.frame(names=names,length=length,philosophy_coefficients=philosophy_coefficients,one=coushudeshuju,two=yirancoushu,three=zuizhongcoushu)
head(info,8)
## names length philosophy_coefficients one two three
## 1 田所浩二 11 25 1 11 1
## 2 远野 14 25 2 4 1
## 3 德川 19 15 3 5 2
## 4 我修院 19 15 4 14 3
## 5 比利♂王 98 100 5 19 5
## 6 Van 81 95 6 19 8
## 7 木吉Kazuya 45 98 7 8 13
## 8 魔♂男 51 95 8 10 21
计算统计量
mean(info$length)
## [1] 42.25
sd(info$length)
## [1] 32.84052
var(info$length)
## [1] 1078.5
quantile(info$length)
## 0% 25% 50% 75% 100%
## 11.00 17.75 32.00 58.50 98.00
这八位哲学♂家的攻击范围均值为42.25,方差为32.84052,标准差为1078.5,四分位数分别是11.00,17.75,32.00,58.50,98.00
数据可视化 ######直方图
hist(info$length,xlab = "攻击范围",col = c("#66ccff","#FF69B4","#9932CC","#D2691E","#FFA07A"),main = "length")
#箱线图
boxplot(info$philosophy_coefficients,col="#66ccff",xlab="哲学♂系数")
#柱形图
barplot(info$philosophy_coefficients,
names.arg = info$philosophy_coefficients,
col = c("#66ccff","#FF69B4"),
ylab = "哲学♂系数")