var() with 0-length vector -- docs inconsistent with result
R 3.5.1 on Windows 7
The documentation for 'var' says: "These functions return 'NA' when there is only one observation (whereas S-PLUS has been returning 'NaN'), and fail if 'x' has length zero." The function 'sd' (based on 'var') has similar documentation.
However, I get:
rather than an error.
Personally I prefer that basic summary functions like 'var' not throw errors even in corner cases. But either way, the result and the docs are inconsistent.
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1