服务热线
178 0020 3020
R2-10 第五期 雷达图
rm(list = ls())
work.dir <- "D:/R Learning/exercise/R2-05/R2_5_data/"
setwd(work.dir)
getwd() #check working directory
library(fmsb)
data5_1 <- mtcars[c(29:32),c(1:9)]
radarchart(data5_1, axistype =2,seg = 2, maxmin=F,centerzero = F,pty = 16,plty =1,plwd = 2,title = "R2-10")
legend("bottomleft",legend = c("Ford Pamtera L","Ferrari Dino",
"Maserati Bora","Volvo 142E"),lty = c(1,1,1,1),
pch = c(16,16,16,16),col = c("black","red","green","blue"),
cex = 0.8,bty = "n")
#重新安装R3.4.3
install.packages("devtools")
devtools::install_github("ricardo-bion/ggradar", dependencies=TRUE)
library(ggradar)
data5_2 <- read.csv("R2_5_data.csv", header=TRUE)
ggradar(data5_2,axis.label.size = 6,grid.line.width = 1,group.point.size = 4,group.line.width = 1,legend.text.size = 10,plot.title="R2-10")+theme(legend.position = "bottom")
附件