[R] a trick ??

vito muggeo vito.muggeo at giustizia.it
Tue Feb 26 16:08:09 CET 2002


diag(rep(diag(A),p))

,of course.

(If I understand what you mean)
cheers,
vito


----- Original Message -----
From: Olivier Martin
To: r-news
Sent: Tuesday, February 26, 2002 1:09 PM
Subject: [R] a trick ??


Dear R users,
Suppose i have an A square matrix rxr. I want to obtain a block matrix  B
(pxr,pxr) where
the p diagonal blocks are A and  the others values are 0.
I would like to do something like : diag(A,ncol=pr, nrow=pr)
How can i do it ??
Thanks in advance,
Olivier.
--
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Olivier MARTIN
PhD student                  phone: (33) 04 76 61 53 55
Projet IS2                               06 08 67 93 42
INRIA Rhone-Alpes            fax  : (33) 04 76 61 54 77
655, Av. de l'Europe
Montbonnot                   e-mail:olivier.martin at inrialpes.fr
38334 Saint Ismier cedex
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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