我试图在Windows 10中使用PC中的PC来绘制我的数据集。但是在绘图时我收到了消息
零长度'标签'指定
以下是数据集和代码:
Taxon,L/D1 ,L/D4,L/DL,Di.Pro.,ST,H.Fo/H.Ch
1,3,2.9,2.28,200,2,1
1,1.33,2.3,2.44,225,2,1
1,2,2.52,2.4,150,2,1
1,3.5,2.75,2.32,125,2,1
1,3.18,2.81,2,125,2,1
1,2.35,3,2.82,125,2,1
1,2.72,2.28,2.09,250,2,1
2,3.6,2.82,2.65,125,4,1
2,2.5,2.7,3.02,150,4,1
2,3.2,2.6,2.7,150,4,1
2,2.4,3.3,2.7,200,4,1
2,3,2.87,3.08,175,4,1
3,2,2.83,2,100,1,0.67
3,4,2.66,2.26,100,1,0.67
3,2.33,2.78,2.28,150,1,0.67
3,2,2.83,2.3,100,1,0.67
4,2.83,2.83,2.66,200,1,0.66
4,3.66,2.57,2.27,100,1,0.66
4,3.33,2.9,2.25,150,1,0.66
4,4.33,3.09,2.15,125,1,0.66
4,1.85,2.44,2.43,225,1,0.66
4,2.85,2.57,2.65,175,1,0.66
4,2.8,2.55,2.2,200,1,0.66
4,1.85,2.57,2.04,175,1,0.66
5,2.83,2.5,3,125,3,0.66
5,2.8,4,3.14,200,3,0.66
5,2,3.5,2.4,200,3,0.66
5,3,3.42,2.9,150,3,0.66
5,2.4,2.6,2.71,175,3,0.66
5,4,3.37,2.52,125,3,0.66
5,1.75,2.69,2.9,250,3,0.66
5,2,2.54,2.76,200,3,0.66
5,2.4,3.25,2.46,175,3,0.66
6,3.5,3.14,2.48,75,5,1
6,2.25,2.16,2.1,75,5,1
6,3,3.23,2.77,125,5,1
6,2.5,2.3,1.85,100,5,1
6,2.95,2.71,2.14,100,5,1
6,2.5,3.4,3.09,125,5,1
6,2,2.57,2.3,100,5,1
6,3,2.55,2.46,125,5,1
7,3,4.76,2.94,100,1,1
7,1.66,2.77,2.2,200,1,1
7,2.16,2.8,2.4,250,1,1
8,2.25,3.09,2.83,150,3,1
8,3.5,3.5,2.88,125,3,1
8,3.33,2.87,3.04,150,3,1
library(vegan)
daz= read.csv (file.choose())
cor(daz)
daz.pca<-rda(daz)
summary(daz.pca)
PCA1,2
daz.taxon.pca <- rda(daz[,c(2:7)],scale=T)
par(pty="s")
plot(scores(daz.taxon.pca,display="sites",choices=1),scores(daz.taxon.pca,display="sites",choices=2),type="n",xlab="PCA1 (99.69%)",ylab="PCA2 (0.19%)",xlim=c (-8.00,8.00),ylim=c(-2.00,1.50))
abline(v=0,lty=3)
abline(h=0,lty=3)
arrows(0,0,scores(daz.taxon.pca,display="species",choices=1),scores(daz.taxon.pca,display="species",choices=2),length=0.10,col="dark gray")
text(scores(daz.taxon.pca,display="sites",choices=1),scores(daz.taxon.pca,display="sites",choices=2),as.character(daz$taxon),cex=0.7)
text.default中的错误(得分(daz.taxon.pca,display =&#34; sites&#34;,choice) = 1),:零长度&#39;标签&#39;指定的
有任何帮助吗?我对R很新,但没有找到任何有关此错误的解释。一般来说代码看起来很好,除非我添加
text(scores(daz.taxon.pca,display="sites",choices=1),scores(daz.taxon.pca,display="sites",choices=2),as.character(daz$taxon),cex=0.7)
对于情节,错误出现了。任何暗示都将非常感激。