[R] Rbind help needed
Robin Hankin
r.hankin at auckland.ac.nz
Wed Nov 27 20:44:54 CET 2002
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list