r-为什么我会收到警告信息";在图中,xy(xy,type,..):通过强制引入的NA"

  • 本文关键字:quot xy type NA 信息 警告 r warnings
  • 更新时间 :
  • 英文 :

plot(productivity$productivity,productivity$mammals, pch=16, col=as.numeric(productivity$region))

当我输入这个时,我会收到警告信息。

可能警告来自as.numeric(productivity$region)-您可以通过运行该命令进行验证。如果为as.numeric提供无法转换为数字的值,则会收到该警告,例如,as.numeric(c("1", "2"))不发出警告,as.numeric(c("1", "hello"))发出警告("hello"转换为NA(。

最新更新