Re: [Rd] sample() fails with double or integer NA input of length one

2016-07-18 Thread Martin Maechler
> Travis McArthur > on Sat, 16 Jul 2016 14:40:28 -0500 writes: > Hi, > I have discovered that sample() fails with an uninformative error > message when the x argument is a single NA of type double or integer. > I can reproduce the problem

[Rd] sample() fails with double or integer NA input of length one

2016-07-16 Thread Travis McArthur
Hi, I have discovered that sample() fails with an uninformative error message when the x argument is a single NA of type double or integer. I can reproduce the problem with the following code: base::sample(NA) # NA is of logical type above base::sample(NA_character_) base::sample(NA_complex_)