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 and

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

[R] replace NA value with 0

2007-09-14 Thread Alfredo Alessandrini
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 89 98 131 153 148 175 NA 1994 177 123 146 124 121 200 266 191 240 106 1995 145 98 95 89 95 130 183 161 164 129 1996 145 98 89 90 93

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 89 98

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... Woudn't it be better to

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 acknowledged

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 it

Re: [R] replace NA value with 0

2007-09-14 Thread John Kane
Seconded. --- Greg Snow [EMAIL PROTECTED] wrote: -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