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