Re: [R] Replace Values in Matrix

2009-11-27 Thread smu
matritz[is.na(matritz)] <- 0 On Fri, Nov 27, 2009 at 04:15:45PM -0200, Romildo Martins wrote: > Hello, > > how to replace the "NA" by number zero? > > > matrizt > [,1] [,2] [,3][,4] > [1,] 1.000NA NA NA > [2,] 0

Re: [R] Replace Values in Matrix

2009-11-27 Thread baptiste auguie
Hi, Try this, matrizt[is.na(matrizt)] <- 0 HTH, baptiste 2009/11/27 Romildo Martins : > Hello, > > how to replace the "NA" by number zero? > >> matrizt >                 [,1]           [,2]             [,3]        [,4] > [1,] 1.000            NA             NA         NA > [2,] 0.6717685 0

[R] Replace Values in Matrix

2009-11-27 Thread Romildo Martins
Hello, how to replace the "NA" by number zero? > matrizt [,1] [,2] [,3][,4] [1,] 1.000NA NA NA [2,] 0.6717685 0.1453253 NA NA [3,] 0.3971276 0.1493241 0.14532526 NA [4,] 0.1493241 0.1453