s-news
[Top] [All Lists]

extending matrices

To: s-news@lists.biostat.wustl.edu
Subject: extending matrices
From: Karl "Hülber" <huelber@yahoo.com>
Date: Tue, 31 Jan 2006 07:26:40 -0800 (PST)
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=252yu5HlrQY8IwKtCQpOC+kmIpH6bevzoRQ6n/nO/iCgQ/d5EPdkM667TFK5pHu9TyPxDrOyi2krExCO6IT1ZkWyLL7tAh8Z3GxkA4RPt6QfR+UWPe904cOekNaLmC1V08eHY7L2IvCw/6nyAN9sQE6EsOern+CSpMNVn0yZ8VA= ;
Can anybody tell me a nifty way to expand a matrix or
data.frame in the following way:
Given are two matrices with partially corresponding
column names: e.g. MAT1 has columns ?a?, ?b? and ?d?;
MAT2 has columns ?a?, ?c?, ?d? and ?f?. I want to add
all columns only occurring in MAT2 to MAT1 and
vice-versa (missing values filled with 0).
Consequently resulting matrices share the same columns
- in the same alphabetic order.

Any help would be greatly appreciated!
Karl

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

<Prev in Thread] Current Thread [Next in Thread>
  • extending matrices, Hülber <=