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

2010-01-18 Thread maiya
Peter, you're right about the error - I had R commander open and used the terminal instead - this makes me miss the error messages. Not that I would have known how to solve it had I seen it :) And yes, ifelse does work. Not sure I understand what the difference is, but thanks! David, I had no id

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

2010-01-17 Thread Ben Bolker
David Winsemius 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 depen

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

2010-01-17 Thread David Winsemius
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 chang

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

2010-01-17 Thread Peter Ehlers
Are you telling us the whole story? Or did you also get a warning message which should have twigged the answer for you? Try ifelse() instead of if(). -Peter Ehlers maiya wrote: There must be a very basic thing I am not getting... I'm working with some entropy functions and the convention is