Re: [R] merge large matrices

From: Sarah Goslee <sarah.goslee_at_gmail.com>
Date: Fri 03 Jun 2005 - 06:28:46 EST

On 6/2/05, Stefan Mischke <mischke@sozpsy.unizh.ch> wrote:
> Dear List
>
> I have two large matrices A and B. Both have the same dimensions, let's
> say 20k x 30k. About half the cells of B are missing. Now I'm looking
> for an efficient way to merge them, so that the missing values in B are
> replaced by the corresponding values of A.

How about:
B[is.na(B)] <- A[is.na(B)]

Sarah

-- 
Sarah Goslee
http://www.stringpage.com

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Jun 03 06:39:35 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:22 EST