[R] combining matrices

From: Marten Winter <marten.winter_at_ufz.de>
Date: Thu, 21 Apr 2011 16:03:51 +0200


Heja,

I hope someone is still there to help me:

How can I somehow merge/combine matrices to get such a result:

Matrix A

A B
x1 1 0
x2 1 1

Matrix B

C D
x3 1 0
x4 0 1

Resulting Matrix?

A B C D
x1 1 0 0 0
x2 1 1 0 0
x3 0 0 1 0
x4 0 0 0 1

Does anyone see this probably obvious solution with R how to do this? Sorry if this question is silly...it's too hot here to think properly ;O)

Thanks!
cheers
Marten

-- 

--------------------------------------------------------------------------------------------
Dr. Marten Winter / Researcher Biozönoseforschung / Community Ecology Helmholtz-Zentrum für Umweltforschung GmbH - UFZ Helmholtz Centre for Environmental Research GmbH - UFZ Theodor-Lieser-Str. 4 / 06120 Halle (Saale) / Germany Telefon +49 345 558 5316 / Fax +49 345 558 5329 marten.winter_at_ufz.de / www.ufz.de/index.php?en=7081 Sitz der Gesellschaft: Leipzig Registergericht: Amtsgericht Leipzig, Handelsregister Nr. B 4703 Vorsitzender des Aufsichtsrats: MinR Wilfried Kraus Wissenschaftlicher Geschäftsführer: Prof. Dr. Georg Teutsch Administrativer Geschäftsführer: Dr. Andreas Schmidt
--------------------------------------------------------------------------------------------
DAISIE - Delivering Alien Invasive Species Inventories for Europe www.europe-aliens.org ______________________________________________________________________________________________________________ „Fakten bedeuten gar nichts! Mit Fakten kann man ja alles beweisen, was auch nur im Entferntesten wahr ist!“ „Facts are meaningless! You could use facts to prove anything that's even remotely true!” (Homer Simpson) ______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Thu 21 Apr 2011 - 14:38:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 21 Apr 2011 - 16:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive