服务热线
178 0020 3020
summary(mtcars)
maxmin<-data.frame(mpg=c(35,10),cyl=c(8,4),disp=c(500,50),hp=c(350,50),drat=c(5,2.5),wt=c(5.5,1.5),qsec=c(23.0,14.5),vs=c(1,0),am=c(1,0))
data1<-mtcars[c(29:32),c(1:9)]
data2<-rbind(maxmin,data1)
library(fmsb)
radarchart(data2, axistype = 1, seg = 2, centerzero = F,plty = 1,cglcol = "black",title="R2-33")+
+ legend("bottomleft",lty = 1, lwd = 2.5, cex= 0.75, legend = rownames(mtcars[29:32,]),pch = 20, col=c("black","red","green","blue"),pt.cex = 1.25,bty = "n")
# maxmin 设置各个变量的取值范围(即最小值和最大值,相当于二维图的x轴和y轴的取值范围)
# rbind把数据集 maxmin 和 data1 组合成为新的数据集
# seg 100%分成几等分
# centerzero T 为实心,最小值从图形中心开始,F 为圆圈。
Install.packages(“devtools”)
devtools::install_github("ricardo-bion/ggradar",dependencies=TRUE)
library(ggplot2)
library(ggradar)
ggradar(data4,axis.label.size=5,grid.line.width=1,group.line.width=1,group.point.size=2,grid.label.size =10)+theme(legend.position="bottom")+ggtitle("R2-33")
遗憾:为能找到如何缩小刻度的方法
附件