0
我打字R中的一些代码,发现“任何”功能给出警告信息
> any(range(2.0,3.0))
给我的以下内容:
Warning message:
In any(range(2, 3)) : coercing argument of type 'double' to logical
我抬头帮助功能通过键入? any
,得到了以下内容:
Coercion of types other than integer (raw, double, complex, character, list) gives a warning as this is often unintentional.
所以我输入any(range(2,3))
,仍然得到了同样的警告。难道我做错了什么?
我想测试是否有任何数字是负数。 – wwl
@wwl但是'any'不会(直接)这样做。是什么让你这么想? –
糟糕,我的代码应该是任何(范围(2,3)<0)。抱歉! – wwl