Skip to content
Prev 12092 / 398502 Next

replace() in matrix

Probably not the most elegant, but if you have
tmp <- matrix(like below)
(1-(tmp==1))*tmp 
should give you the desired result.

-Ryan Elmore
PSU - Dept of Statistics
On Mon, 2 Jul 2001, Tord Snall wrote:

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