Hi Martin,

I got my initial question fully answered.
I do not have enough experience to to judge whether the behavior of R with
regard to Inf is "excellent" or "better" than Perl.

In my opinion, both Perl and R are great languages, designed for very
different applications.
So instead of me trying to impose The Perl Way upon R, I would like to say
how very grateful I am to the contributors to the R core and other packages,
and to the contributors to the R mailing lists. Because this is what I
really feel. R and its packages have been very useful to me on countless
occasions. Thank you, Martin and Greg!

Best regards,

Timur

On Sat, Sep 13, 2008 at 8:48 AM, Martin Maechler <maechler@stat.math.ethz.ch
> wrote:

> >>>>> "TS" == Timur Shtatland <tshtatland@gmail.com>
> >>>>>     on Fri, 12 Sep 2008 11:52:25 -0400 writes:
>
>    TS> I am more used to getting an error if you try to take
>    TS> the log of 0, like this (in Perl):
>
>    TS> perl -le 'for my $num (1, 0, -1, -2) { print log $num;
>    TS> }' 0 Can't take log of 0 at -e line 1.
>
>    TS> R is different. With R, you do not even get a *warning*
>    TS> about log(0). Only log() of negative number produces a
>    TS> warning:
>
>  [............]
>
> and why do you think the perl behavior to be better??
> R has been very carefully designed in such matters:
>
> The principle is that *limits* should work (using +/-Inf) were
> possible.
> For log(.) the limit only exists from the right and clearly is
> -Inf, so that's a feature.
>
> BTW,  S/R behavior of  1/0 |--> Inf   could be considered as
> more dangerous, since really the +Inf is the limit from the
> right only with the limit from the left being ``quite
> different''.
> But no, I'm not proposing to change R here (and actually would
> "fight" to keep it if that was necessary).
>
>
>    TS> I agree with you that Spearman's correlation's invariance to
> monotone
>    TS> transformations is an advantage. It is R's happy
>    TS> attitude to -Inf and Inf that puzzled me at
>    TS> first. Anyhow, verifying and/or preprocessing the input
>    TS> to cor() is the answer to my questions.  Thank you again
>    TS> for the help!
>
> So you now have understood that R's behavior of handling +/- Inf
> in this respect is rather  excellent  than bogous ?
>
> Martin Maechler, ETH Zurich (and R-core team)
>

	[[alternative HTML version deleted]]

