From ihaka@stat.auckland.ac.nz  Thu Sep  4 23:44:51 1997
From: ihaka@stat.auckland.ac.nz (Ross Ihaka)
Date: Fri, 5 Sep 1997 10:44:51 +1200 (NZST)
Subject: R-alpha: inconsistency R/Splus of sample()
In-Reply-To: <199709040852.KAA01531@galadriel.ci.tuwien.ac.at>
References: <199709040852.KAA01531@galadriel.ci.tuwien.ac.at>
Message-ID: <199709042244.KAA18311@stat1.stat.auckland.ac.nz>

Friedrich Leisch writes:
 > 
 > 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.

Done.  (A one character change).
	Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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()
Ross Ihaka