Revision: 1083
http://svn.sourceforge.net/r-gregmisc/?rev=1083&view=rev
Author: warnes
Date: 2007-03-23 15:53:00 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
Allow permutations for r>n provided repeats.allowed=TRUE
Modified Paths:
--------------
trunk/gtools/R/combinations.R
Modified: trunk/gtools/R/combinations.R
===================================================================
--- trunk/gtools/R/combinations.R 2007-03-22 17:12:16 UTC (rev 1082)
+++ trunk/gtools/R/combinations.R 2007-03-23 22:53:00 UTC (rev 1083)
@@ -62,8 +62,8 @@
|| r < 1 || (r %% 1) != 0) stop("bad value of r")
if(!is.atomic(v) || length(v) < n)
stop("v is either non-atomic or too short")
- if( (r > n) ) #& repeats.allowed==FALSE)
- stop("r > n") # and repeats.allowed=FALSE")
+ if( (r > n) & repeats.allowed==FALSE)
+ stop("r > n and repeats.allowed=FALSE")
if(set) {
v <- unique(sort(v))
if (length(v) < n) stop("too few different elements")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|