Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我在R中创建散点图的命令无效_R - Fatal编程技术网

我在R中创建散点图的命令无效

我在R中创建散点图的命令无效,r,R,我正在看用R studio创建散点图的教程 数据集“Iris”的名称。我正在使用教程中的代码,但出现了错误。 我的代码如下: scatterplot(Sepal.Width~Sepal.Length|Species, data=iris, xlab="Sepal Width", ylab="Sepal.Length", main="Iris Data", labels=row.names(iris)) 错误消息如下所示: scatterplot(Sepal.Width~

我正在看用R studio创建散点图的教程 数据集“Iris”的名称。我正在使用教程中的代码,但出现了错误。 我的代码如下:

scatterplot(Sepal.Width~Sepal.Length|Species, data=iris, xlab="Sepal Width",
            ylab="Sepal.Length", main="Iris Data", labels=row.names(iris))
错误消息如下所示:

scatterplot(Sepal.Width~Sepal.Length|Species, data=iris, xlab="Sepal Width",
            ylab="Sepal.Length", main="Iris Data", labels=row.names(iris))
轴中的错误(侧=侧,at=处,标签=标签,…):
提供了“标签”,而不是“在”另外:警告消息:1:In plot.window(…):“labels”不是图形参数2:In plot.xy(xy,type,…):“labels”不是图形参数


如果您有任何建议,我们将不胜感激:)

如果不了解更多有关
散点图
功能的信息,就很难说出哪里出了问题。从警告消息来看,它似乎与参数
labels
有关。正如错误消息所说,
“labels”不是一个图形参数。如果您只需删除代码中写有
labels=row.names(iris)
的部分,您的代码就会正常工作。我不太确定您想用标签部分实现什么,但这将让您开始。顺便说一句,您显然使用了
car
包来获得函数
散点图
。如果您在代码中包含语句
library(car)
,这样我们就不必弄清楚您使用的是什么软件包,这将对这里的人们有所帮助。