Re: [Rd] var() with 0-length vector -- docs inconsistent with result

2018-09-12 Thread Martin Maechler
> Raubertas, Richard via R-devel > on Tue, 11 Sep 2018 18:52:55 + writes: > 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

[Rd] var() with 0-length vector -- docs inconsistent with result

2018-09-11 Thread Raubertas, Richard via R-devel
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: var(numeric(0)) [