[R] rbind question

2003-07-08 Thread David Andel
Hi I am trying to replicate a vector in n rows for comparison purposes with another matrix. foo - c(1,2,3) bar - rbind(foo,foo) # does the trick for 2 rows bar - rbind(rep(foo,2)) # does something else How do I generate a matrix with all rows=foo without writing 'foo' n times as arg? Thanks,

RE: [R] rbind question

2003-07-08 Thread Liaw, Andy
Using the recyling rule: bar - matrix(foo, nrow=n, ncol=length(foo), byrow=TRUE) HTH, Andy -Original Message- From: David Andel [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 9:58 AM To: [EMAIL PROTECTED] Subject: [R] rbind question Hi I am trying to replicate

Re: [R] rbind question

2003-07-08 Thread John Zhang
-Scanned: by amavisd-milter (http://amavis.org/) X-Spam-Status: No, hits=-5.3 required=5.0 tests=BAYES_01, HAS_ORGANIZATION version=2.54 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.54 (1.174.2.17-2003-05-11-exp) Subject: [R] rbind question X-BeenThere: [EMAIL PROTECTED] X-Mailman-Version: 2.1.2

RE: [R] rbind question

2003-07-08 Thread Wayne Jones
What about: matrix(rep(foo,2),ncol=length(foo),byrow=TRUE) -Original Message- From: David Andel [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 14:58 To: [EMAIL PROTECTED] Subject: [R] rbind question Hi I am trying to replicate a vector in n rows for comparison purposes

Re: [R] rbind question

2003-07-08 Thread Emmanuel Paradis
Hi David, At 15:58 08/07/2003 +0200, vous avez écrit: Hi I am trying to replicate a vector in n rows for comparison purposes with another matrix. foo - c(1,2,3) bar - rbind(foo,foo) # does the trick for 2 rows bar - rbind(rep(foo,2)) # does something else This is because `rep()' is executed

Re: [R] rbind question

2003-07-08 Thread Sundar Dorai-Raj
David Andel wrote: Hi I am trying to replicate a vector in n rows for comparison purposes with another matrix. foo - c(1,2,3) bar - rbind(foo,foo) # does the trick for 2 rows bar - rbind(rep(foo,2)) # does something else How do I generate a matrix with all rows=foo without writing 'foo' n

Re: [R] rbind question

2003-07-08 Thread Göran Broström
On 8 Jul 2003, David Andel wrote: Hi I am trying to replicate a vector in n rows for comparison purposes with another matrix. foo - c(1,2,3) bar - rbind(foo,foo) # does the trick for 2 rows bar - rbind(rep(foo,2)) # does something else How do I generate a matrix with all rows=foo

Re: [R] rbind question

2003-07-08 Thread Patrick Burns
do.call(rbind, rep(list(foo), n)) Patrick Burns Burns Statistics [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) David Andel wrote: Hi I am trying to replicate a vector in n rows for comparison purposes with another