Re: [R] How to replace NA with zero (0)

2012-05-03 Thread Mercier Eloi
Hello, When i generate data with the code below there appear NA as part of the generated data, i prefer to have zero (0) instead of NA on my data. Is there a command i can issue to replace the NA with zero (0) even if it is after generating the data? Thank you ?Surv time2: ending time of the

Re: [R] How to replace NA with zero (0)

2012-05-03 Thread Steve Lianoglou
Also, On Thu, May 3, 2012 at 1:57 PM, J Toll wrote: > On Thu, May 3, 2012 at 10:43 AM, Christopher Kelvin > 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

Re: [R] How to replace NA with zero (0)

2012-05-03 Thread Rolf Turner
On 04/05/12 03:43, Christopher Kelvin wrote: Hello, When i generate data with the code below there appear NA as part of the generated data, i prefer to have zero (0) instead of NA on my data. Is there a command i can issue to replace the NA with zero (0) even if it is after generating the dat

Re: [R] How to replace NA with zero (0)

2012-05-03 Thread J Toll
On Thu, May 3, 2012 at 10:43 AM, Christopher Kelvin 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:

[R] How to replace NA with zero (0)

2012-05-03 Thread Christopher Kelvin
Hello,  When i generate data with the code below there appear NA as part of the generated data, i prefer to have zero (0) instead of NA on my data. Is there a command i can issue to replace the NA with zero (0) even if it is after generating the data?  Thank you library(survival) p1<-0.8;b<-1.5;