Skip to content
Prev 293468 / 398503 Next

How to replace NA with zero (0)

On Thu, May 3, 2012 at 10:43 AM, Christopher Kelvin
<chris_kelvin2001 at yahoo.com> wrote:

            
Chris,

I didn't try your example code, so this suggestion is far more
general, but you might try something along the lines of:

x[which(is.na(x))] <- 0

Best,

James