[R] change NA values

Martin Elff elff at sowi.uni-mannheim.de
Tue Feb 19 12:58:16 CET 2008


On Tuesday 19 February 2008 (12:33:21), Alfonso Pérez Rodríguez wrote:
> Hello, I'm sure that this question is too simple, but, I'm begining with R
> and I'm not able to change the NA values in a matrix by 0 values, and it's
> necessary for my work, how can I do It? Thank you.

your.matrix[is.na(your.matrix)] <- 0

Best,

Martin



More information about the R-help mailing list