2015-05-12 47 views
0

即使我使用其他人的教程而不是我自己的數據(例如本站:http://planspace.org/2013/02/03/pca-3d-visualization-and-clustering-in-r/),我仍然在text3d中收到錯誤。示例代碼,錯誤如下。 plot3d似乎工作正常,但任何想法我缺少text3d?text3d錯誤,未使用的參數

謝謝!

library(rgl) 
plot3d(pc$scores[,1:3]) 
text3d(pc$scores[,1:3],texts=rownames(iris)) 
#Error in text3d(pc$scores[, 1:3], texts = rownames(iris)) : 
# unused argument (texts = rownames(iris)) 
text3d(pc$loadings[,1:3], texts=rownames(pc$loadings), col="red") 
#Error in text3d(pc$loadings[, 1:3], texts = rownames(pc$loadings), col = "red") : 
# unused argument (texts = rownames(pc$loadings)) 
coords <- NULL 
for (i in 1:nrow(pc$loadings)) { 
    coords <- rbind(coords, rbind(c(0,0,0),pc$loadings[i,1:3])) 
} 
lines3d(coords, col="red", lwd=4) 
+1

我無法複製您的錯誤。如果'pc'只是'pc < - princomp(iris [,1:4],cor = TRUE,scores = TRUE)',就像你的鏈接一樣,一切正常。 – thelatemail

回答

0

R版本更新到3.1.3是答案(運行R版本3.0.2)。謝謝!

相關問題