尝试在R studio中运行名称(x)时返回错误?

尝试在R studio中运行名称(x)时返回错误?,r,R,我是R领域的新手,对编程知之甚少。如果可以的话,请帮我解决这个问题 当我尝试在RGui中运行函数“names(x)”时,一切正常。它返回了我输入的名称属性,否则将返回“NULL” 然而,当我尝试在Rstudio中做同样的事情时,它返回了 x 在注释中,您可以看到: For vectors, the names are one of the attributes with restrictions on the possible values. 我想,您应该设置属性来获取它的名称。我的Rstu

我是R领域的新手,对编程知之甚少。如果可以的话,请帮我解决这个问题

当我尝试在RGui中运行函数“names(x)”时,一切正常。它返回了我输入的名称属性,否则将返回“NULL”

然而,当我尝试在Rstudio中做同样的事情时,它返回了

x 在注释中,您可以看到:

For vectors, the names are one of the attributes 
with restrictions on the possible values.

我想,您应该设置属性来获取它的名称。

我的Rstudio中没有任何错误。重新打开Rstudio或重新安装iThanks!我清理了环境中的对象,不再弹出错误。谢谢您的回答。我知道我可以在attributes下看到名称,但是names()对我来说是一个更方便的函数。不管怎样,我终于解决了这个问题。谢谢
For vectors, the names are one of the attributes 
with restrictions on the possible values.