[R] function to set log(0)=0 not working on tables or vectors

Ben Bolker bolker at ufl.edu
Mon Jan 18 05:05:52 CET 2010


David Winsemius <dwinsemius <at> comcast.net> writes:

> 
> 
> On Jan 17, 2010, at 8:17 PM, maiya wrote:
> 
> >
> > There must be a very basic thing I am not getting...
> >
> > I'm working with some entropy functions and the convention is to use
> > log(0)=0.
> >
> 
> I suppose the outcome of that effort may depend on whether you have  
> assumed the needed godlike capacities to change the laws of  
> mathematics. But I suppose that as the Earth mother that might occur  
> to you. Go ahead, define a new mathematics.

  My guess is that the real intention here is 
to define 0*log(0) = 0 rather than log(0) = 0 -- 
really the assertion is that lim(x -> 0) x log(x) = 0,
which must be true for some reasonable limiting conditions.



More information about the R-help mailing list