From wdunlap at tibco.com  Wed Mar 10 18:35:39 2010
From: wdunlap at tibco.com (William Dunlap)
Date: Wed, 10 Mar 2010 09:35:39 -0800
Subject: [Rd] log2(quote(1:10)) evaluates the quoted 1:10, log() does not
Message-ID: <77EB52C6DD32BA4D87471DCD70C8D70002A0F362@NA-PA-VBE03.na.tibco.com>

This is very minor, but shouldn't log2(quote(1:10))
throw an error,the same as log() and other math functions
do?  It looks like log2 and log10 evaluate a call object
instead of throwing a non-numeric-argument error.  They
do object to non-call language objects, like expressions.

  > log2(quote(1:10))
   [1] 0.000000 1.000000 1.584963 2.000000 2.321928 2.584963
   [7] 2.807355 3.000000 3.169925 3.321928
  > log(quote(1:10))
  Error in log(quote(1:10)) : Non-numeric argument to mathematical
function
  > sqrt(quote(1:10))
  Error in sqrt(quote(1:10)) :
    Non-numeric argument to mathematical function
  > quote(1:10) ^ 2
  Error in quote(1:10)^2 : non-numeric argument to binary operator
  > 2 ^ quote(1:10)
  Error in 2^quote(1:10) : non-numeric argument to binary operator

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 



[Rd] log2(quote(1:10)) evaluates the quoted 1:10, log() does not
William Dunlap