Also,

On Thu, May 3, 2012 at 1:57 PM, J Toll <jct...@gmail.com> wrote:
> On Thu, May 3, 2012 at 10:43 AM, Christopher Kelvin
> <chris_kelvin2...@yahoo.com> wrote:
>
>> Is there a command i can issue to replace the NA with zero (0) even if it is 
>> after generating the data?
>
> 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

Random note from left field: the call to `which` is unnecessary here.

-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to