I seem to be on a roll of being dumb today. Sorry for posting my previous silly solution to Erin's permutation problem. Please **do** ignore it.
-- Bert > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Berton Gunter > Sent: Wednesday, August 02, 2006 10:32 AM > To: 'Erin Hodgess'; [email protected] > Subject: Re: [R] listing of permutations > > Erin: > You got 2 (so far) pre-packaged functions .Here's an > obscenely inefficient > but short un-prepackaged way to do it: > > k<-4 > z<- do.call('expand.grid',as.data.frame(matrix(rep(1:k,k),nc=k))) > results<- z[apply(z,1,function(x)length(unique(x))==k),] > > It is too inefficient to make public, though. > > -- Bert Gunter > Genentech Non-Clinical Statistics > South San Francisco, CA > > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Erin Hodgess > > Sent: Wednesday, August 02, 2006 9:57 AM > > To: [email protected] > > Subject: [R] listing of permutations > > > > Dear R People: > > > > Suppose I have the 4 numbers: 1,2,3,4. > > > > I would like to create a listing of the permutations > > of 4 items taken 4 at a time. > > > > Is there a built in function for that, please? > > > > Thanks in advance! > > R 2-3-1 for Windows or Linux > > Sincerely, > > Erin Hodgess > > Associate Professor > > Department of Computer and Mathematical Sciences > > University of Houston - Downtown > > mailto: [EMAIL PROTECTED] > > > > ______________________________________________ > > [email protected] mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
