library(readxl)
library(aplpack)
library(TeachingDemos)
##
## 载入程辑包:'TeachingDemos'
## The following objects are masked from 'package:aplpack':
##
## faces, slider
library(MSG)
d3.2 <- read_excel('D:/QQ/1229092178/FileRecv/mvexer5.xlsx','E3.2')
d3.2 = as.data.frame(d3.2)
rownames(d3.2) = as.matrix(d3.2[,1])
d3.2 <- d3.2[,-1]
head(d3.2)
## 工业总产值 工业增加值 产品销售收入 产品出口销售收入
## 广州 1486.05 478.55 1454.67 31.75
## 韶关 28.55 7.56 27.75 0.77
## 深圳 3266.52 940.86 3120.18 350.60
## 珠海 465.07 74.60 447.08 37.74
## 汕头 147.73 43.80 140.01 5.39
## 佛山 930.49 191.99 891.08 45.63
barplot(apply(d3.2,2,mean))
barplot(apply(d3.2,1,mean),las = 3)
barplot(apply(d3.2,2,median),col = 1:4)
boxplot(d3.2)
boxplot(d3.2,horizontal = T)
faces(d3.2,ncol = 7)
faces2(d3.2,ncols = 7)
andrews_curve(d3.2)
library(ggplot2)
library(ggradar)
df <- d3.2
ggradar(df,
grid.max = max(df[,-1]),
grid.min = 0,
grid.label.size = 3,
axis.label.size = 3,
group.colours = rainbow(length(df[,1])),
background.circle.colour = "blue",
group.point.size = 1,
group.line.width = 2,
plot.legend = T,
legend.position = "right",
legend.title = "雷达图",
legend.text.size = 10,
plot.title = "Radar",
plot.extent.x.sf = 2,
plot.extent.y.sf = 2,
)
星图是将样本点分而置之的雷达图,区别就是它能够容纳的样本点比雷达图要大,缺点就是它不能对各个变量进行直观的比较。
stars(df)