s-news
[Top] [All Lists]

Re: [splus-users,11557] [S] Combinatory function

To: s-news@wubios.wustl.edu
Subject: Re: [splus-users,11557] [S] Combinatory function
From: TAKEZAWA Kunio <takezawa@affrc.go.jp>
Date: Wed, 23 Jun 1999 08:42:20 +0900
In-reply-to: <199906221414.XAA25328@cabbage.math.keio.ac.jp>
Sender: owner-s-news@wubios.wustl.edu
E-mail: s-news@wubios.wustl.edu

Hi!

>    Is there any S+ function that calculates the combination 
>of that categories?


   How about this? :

dd1<-seq(from=1, by=1, length=5)
comb <- expand.grid(x1 =dd1 , x2 =dd1, x3 =dd1, x4 = dd1, x5=dd1,
xx6=dd1)

This program gives you all combinations of c(1,2,3,4,5).
If you replace "1" by "a", "2" by "b",-----, "5" by "e",
it results in all combinations of a,b,c,d,e.

K. Takezawa

   *****    Kunio Takezawa, Ph.D. (takezawa@affrc.go.jp)    *****
  *****            Research Information Section              *****
 **** Hokuriku National Agricultural Experiment Station, JAPAN ****
*****     <http://www.inada.affrc.go.jp/~takezawa/patent-e.html>    *****
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>