[Rd] error from sample if sampling length one character (PR#2546)

2003-02-13 Thread patrick
Full_Name: Patrick Burns Version: 1.6.1 OS: Suse Linux Submission from: (NULL) (217.36.14.68) Sample gives an error if it is sampling a length one character vector: > sample('a', 1) Error in sample(x, size, replace, prob) : invalid first argument The fix is trivial (numeric test in first line

Re: [Rd] colSums etc. documentation (PR#2545)

2003-02-13 Thread David Brahm
Bert Gunter <[EMAIL PROTECTED]> wrote: > > z > [,1] [,2] > [1,]1 NA > [2,]2 NA > [3,]3 NA > > > colSums(z,na.rm=T) > [1] 6 0 Certainly correct (the empty set has sum 0 and product 1) and consistent with other functions. But you are not the first to mention being surprised b

[Rd] colSums etc. documentation (PR#2545)

2003-02-13 Thread bert_gunter
For your consideration: > z [,1] [,2] [1,]1 NA [2,]2 NA [3,]3 NA > colSums(z) [1] 6 NA Correct, according to the documentation > colSums(z,na.rm=T) [1] 6 0 Surprising to me, but, as documented, correctly consistent with apply() and >sum(NULL) [1] 0 The documentation