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
(。