[R] mask a matrix

Lei Jiang lj22 at u.washington.edu
Fri Jun 10 22:12:49 CEST 2005


Hi, there.

I have two matrix with identical dimentions. matrix A contains 
information of 0 and 1, and matrix B contains data. I only want the data 
in matrix B where matrix A has 1's. the places where matrix A has 0's, I 
want NA's in matrix B.

How do I do that??

Thank you very much.

Lei Jiang

Department of Chemsitry
University of Washington
Box 351700
Seattle, WA 98195
Phone: 206-616-6882
Fax: 206-685-8665




More information about the R-help mailing list