Re: [R] zero fill empty cell in data.frame

From: Rolf Turner <rolf.turner_at_xtra.co.nz>
Date: Tue, 19 Apr 2011 22:45:56 +1200

On 19/04/11 21:39, Simone Gabbriellini wrote:
> Hello List,
>
> I have a data frame like:
>
> V130 V131 V132 V133 V134 V135 V136
> 1 0 0 0.9 0 0.9 0 0
> 2 0 0 0 0 0 0.8
> 3 0 0 0 0 0.9 0 0
> 4 0.9 0 0 0 0 0 0.9
> 5 0 0 0
> 6 0 0 0 0.9 0 0 0.9
> 7 0 0 0.8 0 0 0 0
> 8 0.9 0 0 0.9 0.8 0
> 9 0 0 0 0.9 0.9 0 0
> 10 0 0 0 0 0 0 0.9
>
> I would like to fill the empty cells with a 0... how to address those empty cells?
>
> thanks for your help!

In general, filling empty cells with zeros is ***very bad practice***. Zero is not the same thing as ``missing''. So basically: Don't do this! I don't care
how badly you want to do it, or who told you to do it, just ***don't***.

     cheers,

             Rolf Turner



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. Received on Tue 19 Apr 2011 - 10:48:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Apr 2011 - 11:30:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive