Skip to content
Back to formatted view

Raw Message

Message-ID: <200211271944.gARJisG06848@r.hankin.sges.auckland.ac.nz>
Date: 2002-11-27T19:44:54Z
From: robin hankin
Subject: Rbind help needed
In-Reply-To: <4F57EB97.448AD66C.3520D0D0@aol.com> (Bayesianbay@aol.com)

Hello Mick

Try this:

> a <- matrix(1:4,2,2)
> a
     [,1] [,2]
[1,]    1    3
[2,]    2    4
> kronecker(rep(1,3),a)
     [,1] [,2]
[1,]    1    3
[2,]    2    4
[3,]    1    3
[4,]    2    4
[5,]    1    3
[6,]    2    4
> 

rksh



> 
> Dear list
> 
> I have a very simple question which is causing me problems!
> 
> I have a matrix A and simply want to rbind this matrix together n times (n is a large number)
> How can I write this in R?
> I know I could do new<-rbind(z,z,z,...z) with z written n times but this will take forever as n is so large.
> 
> Is there a simple way to write this?
> 
> Cheers 
> Mick


-- 

Robin Hankin, Lecturer,
School of Geography and Environmental Science
Tamaki Campus
Private Bag 92019 Auckland
New Zealand

r.hankin at auckland.ac.nz
tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042

as of: Thu Nov 28 08:44:01 NZDT 2002
This (linux) system up continuously for:  455 days, 14 hours, 26 minutes
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._