R2-04 第五次作业 雷达图绘制

blanking 2017-12-06 02:11:34 阅读: 1401

第一题

library(fmsb)

summary(mtcars)

color_1 <- c("red","yellow","darkslategray", "green")

maxmin <- data.frame(

  mpg= c(35,10),

  cyl = c(8,4),

  disp = c(500,50),

  hp=c(350,50),

  drat=c(5.0,2.5),

  wt = c(5.5,1.5),

  qsec = c(23.0,14.5),

  vs = c(1,0),

  am = c(1,0)

)

mtcars <- mtcars[,1:9]

dat_1 <-rbind(maxmin,mtcars[29:32,])


radarchart(dat_1, axistype = 1, seg = 2,  centerzero = F,plty = 1, pcol = color_1, cglcol = "black")

legend("left",lty = 1, lwd = 2.5, cex= 0.75, legend = rownames(mtcars[29:32,]),pch = 20, col = color_1,pt.cex = 1.25,bty = "n")



Rplot.png

第二题:

install.packages("devtools")

devtools::install_github("ricardo-bion/ggradar", dependencies=TRUE, force = T)

library(ggplot2)

library(ggradar)

R2_04_5 <- read.csv("/users/taowang/documents/R/R2/R2-5/R2_5_data.csv",header = T)

ggradar(R2_04_5,axis.label.size = 5, grid.label.size = 4, legend.text.size = 10)+ 

  theme(legend.title = element_blank(), legend.position = "top")+

  ggtitle("R2-04")

Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  : 

  polygon edge not found

In addition: There were 46 warnings (use warnings() to see them)

好吧,再见了各位,我实在是搞不定了。

 
邀请讨论

附件

{{f.title}} 大小 {{f.file_size}} 下载 {{f.count_download}} 金币 {{f.count_gold}}
{{item.nick_name}} 受邀请回答 {{item.create_time}}
{{item.refer_comment.nick_name}} {{item.refer_comment.create_time}}

附件

{{f.title}} 大小 {{f.file_size}} 下载 {{f.count_download}} 金币 {{f.count_gold}}
切换到完整回复 发送回复
赞({{item.count_zan}}) 踩({{item.count_cai}}) 删除 回复 关闭
科研狗©2015-2024 科研好助手,京ICP备20005780号-1 建议意见

服务热线

178 0020 3020

微信服务号