Re: [R] replace NA value with 0

2010-03-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 17.03.2010 18:01:50: > > Building on the question how to replace NA with 0. > > My data set below has date, station 1, flags for station 1, station 2, flags > for station 2, etc... > > I would like to make the values in the station columns equal to 1

Re: [R] replace NA value with 0

2010-03-17 Thread ehux
Building on the question how to replace NA with 0. My data set below has date, station 1, flags for station 1, station 2, flags for station 2, etc... I would like to make the values in the station columns equal to 1 and the NA in the station columns equal to 0 and then sum each row for the numbe

Re: [R] replace NA value with 0

2007-09-14 Thread John Kane
gt; Cc: [EMAIL PROTECTED] > > Subject: Re: [R] replace NA value with 0 > > I nominate the following paragraph for the fortunes > package > > > I like this list because if you ask a question, > they don't > > only solve it immediately (in five different &g

Re: [R] replace NA value with 0

2007-09-14 Thread Ted Harding
On 14-Sep-07 09:22:36, S Ellison wrote: > Being a chemist, I have to confess that I can't always tell > that what I'm about to attempt is barking, trivial, uninteresting > or better done a completely different way; myself, I'd rather be > warned too often than left to dig my own pit and fall into i

Re: [R] replace NA value with 0

2007-09-14 Thread Greg Snow
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Gabor Csardi > Sent: Friday, September 14, 2007 2:56 AM > To: S Ellison > Cc: [EMAIL PROTECTED] > Subject: Re: [R] replace NA value with 0 I nominate the following parag

Re: [R] replace NA value with 0

2007-09-14 Thread S Ellison
>>> Ted Harding <[EMAIL PROTECTED]> 14/09/2007 10:59:47 >>> >On the contrary! It adds to our "collective wisdom". > >We all have to suck eggs, and usually can successfully perform the act. Ted, Thanks for the kind remarks. But we'll have to get off the egg topic, or we'll all end up as acknowl

Re: [R] replace NA value with 0

2007-09-14 Thread Gabor Csardi
On Fri, Sep 14, 2007 at 10:22:36AM +0100, S Ellison wrote: [...] > knee-jerk. Apologies if I'm teaching egg-sucking to an expert. No apologies please. As i said I _like_ it. Thanks :) G > S > > *** > This email and any attachment

Re: [R] replace NA value with 0

2007-09-14 Thread S Ellison
>>On Fri, Sep 14, 2007 at 09:46:57AM +0100, S Ellison wrote: >> >>... only you probably shouldn't be doing that at all. Words like 'bias' >>spring to mind... >> >> Woudn't it be better to accept the NA's and find methods that handle them as >> genuinely missing. >> R is usually quite good at

Re: [R] replace NA value with 0

2007-09-14 Thread Gabor Csardi
On Fri, Sep 14, 2007 at 09:46:57AM +0100, S Ellison wrote: > > > >>> Gabor Csardi <[EMAIL PROTECTED]> 14/09/2007 09:27:03 >>> > >x[ is.na(x) ] <- 0 > > > >should work in most cases i think. > > ... only you probably shouldn't be doing that at all. Words like 'bias' > spring to mind... > > Woud

Re: [R] replace NA value with 0

2007-09-14 Thread S Ellison
>>> Gabor Csardi <[EMAIL PROTECTED]> 14/09/2007 09:27:03 >>> >x[ is.na(x) ] <- 0 > >should work in most cases i think. ... only you probably shouldn't be doing that at all. Words like 'bias' spring to mind... Woudn't it be better to accept the NA's and find methods that handle them as genuine

Re: [R] replace NA value with 0

2007-09-14 Thread Gabor Csardi
x[ is.na(x) ] <- 0 should work in most cases i think. Gabor On Fri, Sep 14, 2007 at 10:08:19AM +0200, Alfredo Alessandrini wrote: > Hi, > > how can I replace NA value with 0: > > 1991 217 119 103 109 137 202 283 240 146 NA > 1992 270 174 149 144 166 239 278 237 275 NA > 1993 146 111 104