用R主成分分析画三维图提示错误,求助

  1. 主成分分析做三维图,求助解决下面提示错误;



> zao<-read.table("x:/Yaping.Ma/zao.txt",header=TRUE,sep="\t")
> head(zao)
  Date    x1    x2   x3   x4   x5    x6   x7 x8
1 12-Jul 30.06 11.66 2.02 9.68 4.06 21.41 3.55  0
2 12-Jul 32.18 13.42 2.29 7.96 5.42 22.85 2.59  0
3 12-Jul 28.31 11.56 1.95 7.78 4.07 16.36 3.42  0
4 12-Jul 28.63 11.98 1.99 7.42 4.60 16.01 2.79  0
5 12-Jul 27.42 11.58 1.83 7.30 3.26 18.97 5.07  0
6 12-Jul 24.75 10.25 1.24 6.21 3.10 17.70 4.06  0
> zao.pca<-prcomp(zao[,-1],scale. = TRUE)

> groups<-factor(zao[,1])

> summary(zao.pca)
Importance of components:
                          PC1    PC2    PC3     PC4     PC5
Standard deviation     2.1586 1.2076 0.9174 0.75944 0.52738
Proportion of Variance 0.5824 0.1823 0.1052 0.07209 0.03477
Cumulative Proportion  0.5824 0.7647 0.8699 0.94204 0.97680
                           PC6     PC7       PC8
Standard deviation     0.36470 0.22931 0.0005306
Proportion of Variance 0.01663 0.00657 0.0000000
Cumulative Proportion  0.99343 1.00000 1.0000000
> pca3d(pca,
components = 1:3, col = NULL, title = NULL, new = FALSE,
  axes.color = "grey", bg = "white",
radius = 1, group = NULL,
  shape = NULL, palette = NULL, fancy = FALSE,
biplot = FALSE,
  biplot.vars = 5, legend = NULL, show.scale = FALSE,
  show.labels = FALSE, labels.col = "black",
show.axes = TRUE,
  show.axe.titles = TRUE, axe.titles = NULL,
show.plane = TRUE,
  show.shadows = FALSE, show.centroids = FALSE,
show.group.labels = FALSE,
  show.shapes = TRUE, show.ellipses = FALSE,
ellipse.ci = 0.95)


Error in names(group.val) <- levels(group) : 
  attempt to set an attribute on NULL


 在这总出现这个错误提示,那位大神可以帮忙看看啊,急急!感激不尽

请先 登录 后评论

1 个回答

祝让飞 - 生物信息工程师

错误没有贴全,不知道是啥问题

请先 登录 后评论
  • 1 关注
  • 0 收藏,2879 浏览
  • 马亚平 提出于 2018-06-16 03:29

相似问题