> library(scatterplot3d)
> scatterplot3d(iris$Sepal.Length,iris$Petal.Length,iris$Petal.Width)
> iris.2<-(iris)
> iris.2["Sepal.Area"]<-(pi*iris.2$Sepal.Length*iris.2$Sepal.Width)
> scatterplot3d(iris.2$Sepal.Length*iris.2$Sepal.Width*iris.2$Sepal.Area)
Error in xyz.coords(x = x, y = y, z = z, xlab = xlabel, ylab = ylabel, :
'x', 'y' and 'z' lengths differ第一个散点图可以工作,但是当我尝试使用新列Sepal.Area时,它不起作用。我正在根据现有列创建新列,那么长度会有什么不同呢?允许我使用scatterplot3d( )的修复方法是什么?
发布于 2014-02-20 19:13:11
您有星号(*)分隔第二个scatterplot3d函数中的元素。您应该像在第一个scatterplot3d函数中一样使用逗号(,)。
scatterplot3d(iris.2$Sepal.Length,iris.2$Sepal.Width,iris.2$Sepal.Area)
library(scatterplot3d)
scatterplot3d(iris$Sepal.Length,iris$Petal.Length,iris$Petal.Width)
iris.2<-(iris)
iris.2["Sepal.Area"]<-(pi*iris.2$Sepal.Length*iris.2$Sepal.Width)
scatterplot3d(iris.2$Sepal.Length,iris.2$Sepal.Width,iris.2$Sepal.Area)https://stackoverflow.com/questions/21916590
复制相似问题