From Friedrich.Leisch@ci.tuwien.ac.at  Thu Sep  4 09:52:24 1997
From: Friedrich.Leisch@ci.tuwien.ac.at (Friedrich Leisch)
Date: Thu, 4 Sep 1997 10:52:24 +0200
Subject: R-alpha: inconsistency R/Splus of sample()
Message-ID: <199709040852.KAA01531@galadriel.ci.tuwien.ac.at>


The function sample has different behaviour under R and Splus when
called with zero sample size:

R> x<-rnorm(10)
R> sample(x,0)
Error in sample(length(x), size, replace) : invalid second argument

Splus> x<-rnorm(10)
Splus> sample(x,0)
numeric(0)


IMO the Splus behaviour makes more sense, because it returns the
requested `sample' of size 0.

.f
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: inconsistency R/Splus of sample()
Friedrich Leisch