From pdalgd at gmail.com  Tue Sep  2 13:43:21 2014
From: pdalgd at gmail.com (peter dalgaard)
Date: Tue, 2 Sep 2014 13:43:21 +0200
Subject: [Rd] ggplot2/plyr interaction with latest R-devel?
In-Reply-To: <CABghstQQdS1zgEBjW_cSYAY2M-M3cAQ_oUoUQRY6X80yPWLZQg@mail.gmail.com>
References: <5404BE1D.2020609@mcmaster.ca>
	<CAN_1p9ygzA+Kbb45QKqgASWE9vg11DV0=tLruSsMxWHULfYoCA@mail.gmail.com>
	<CABghstQyz36aboSegmTbKbETGnncK4oc8rc68d6uVcMbpkKOQw@mail.gmail.com>
	<CABghstQQdS1zgEBjW_cSYAY2M-M3cAQ_oUoUQRY6X80yPWLZQg@mail.gmail.com>
Message-ID: <D800863A-31C6-4361-BB5C-036AD5D7C642@gmail.com>

Impressive. Never ceases to amaze me what computers can do these days. ;-)

It's even more impressive given that we have

static double logbase(double x, double base)
{
#ifdef HAVE_LOG10
    if(base == 10) return x > 0 ? log10(x) : x < 0 ? R_NaN : R_NegInf;
#endif
#ifdef HAVE_LOG2
    if(base == 2) return x > 0 ? log2(x) : x < 0 ? R_NaN : R_NegInf;
#endif
    return R_log(x) / R_log(base);
}

which, except possibly for base-10 and base-2, would seem to be quite hard to convince to return anything other than 1 if x == base....


-pd  


On 02 Sep 2014, at 03:27 , Ben Bolker <bbolker at gmail.com> wrote:

> log(8, base=8L)-1
> log(8, base=8)-1
> logvals <- setNames(log(2:25,base=2:25)-1,2:25)
> logvals[logvals!=0]  ## 5,8,14,18,19,25 all == .Machine$double.eps/2

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] ggplot2/plyr interaction with latest R-devel?
peter dalgaard