scatterplot3D 函数似乎绘制不正确,我不确定原因。例如,以下命令应该产生相同的图,但它们不会。我还提供了可重现的代码来创建下面的数据结构。我猜它没有正确处理我的输入?
install.packages("scatterplot3d")
library("scatterplot3d")
cent = array(dim=c(4,3))
cll = c("Factor1", "Factor2", "Factor3")
colnames(cent) = cll
cent[1,] = c(-0.25320707, -0.5878291, -0.4522262)
cent[2,] = c(2.49368231, 0.5911989, -0.3728652)
cent[3,] = c(-0.02927063, -0.2627355, 1.6147719)
cent[4,] = c(-0.63391974, 1.0109955, -0.1542808)
new.cent = array(dim=c(4,3))
colnames(new.cent) = cll
new.cent[1,] = c(2.1572533, 0.4985594, -0.1989068)
new.cent[2,] = c(-0.1362396, -0.4134629, 1.2677813)
new.cent[3,] = c(-0.2566698, -0.6602819, -0.5245323)
new.cent[4,] = c(-0.5847768, 0.7672588, -0.1918044)
现在我尝试绘制
plot.new()
scatterplot3d(new.cent, pch = 10)
points(cent, pch = 3)
plot.new()
scatterplot3d(cent, pch = 3)
points(new.cent, pch = 10)
在任何情况下,上述几点似乎都不正确......此外,如果我尝试像“points(cent [1,])”那样添加一个点,它会添加三个点,这也表明故障。