sum() has a na.rm argument
sum(x, na.rm=TRUE)
On Thu, Jul 22, 2010 at 7:19 PM, jd6688 <jdsignature at gmail.com>
wrote:>
> I have a DF
>
> ID ? VALUE
> 100 ?120
> 101 ?100
> 102 ?100
> 103
> 104
> 105
> ....
>
> when i calculate the sum of the values, it returned NA. should I populate
> the blank value as 0?
>
> Thanks,
>
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/MISSING-VALUE-IN-R-tp2299586p2299586.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>
--
Stephen Sefick
____________________________________
| Auburn University? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? |
| Department of Biological Sciences? ? ? ? ?? |
| 331 Funchess Hall? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
| Auburn, Alabama? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? |
| 36849? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
|___________________________________|
| sas0025 at auburn.edu? ? ? ? ? ? ? ? ? ? ? ? ? ?? |
| http://www.auburn.edu/~sas0025? ? ? ? ? ?? |
|___________________________________|
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.? We are mammals, and have not exhausted the
annoying little problems of being mammals.
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -K. Mullis