[Rd] Bug in subsetting data frame (PR#13515)

William Dunlap wdunlap at tibco.com
Tue Feb 10 18:12:59 CET 2009


> -----Original Message-----
> From: r-devel-bounces at r-project.org 
> [mailto:r-devel-bounces at r-project.org] On Behalf Of Duncan Murdoch
> Sent: Tuesday, February 10, 2009 7:12 AM
> To: Stavros Macrakis
> Cc: xinlee883 at stat.math.ethz.ch; r-devel at stat.math.ethz.ch
> Subject: Re: [Rd] Bug in subsetting data frame (PR#13515)

[ lots deleted ]

> > Indeed!  It is quite surprising that functions are defined 
> using ordinary
> > assignment, but function lookup is different from normal variable
> > evaluation, e.g. that after c<-4, c(10) is different from 
> (c)(10).  Was this
> > inspired by some other language? I don't think it's done 
> this way in any
> > other language I can think of....
> I think originally there was no difference, and it caused the obvious 
> trouble when people used variable names like t and c other short 
> function names, so this was added.  I don't remember whether the 
> different lookup rules showed up first in R or S.
> 
> Duncan Murdoch

Splus 3.4 (July 1996, based on SV3 dated "Apr 30 09:54:11 EDT 1992")
distinguished function vs. non-function lookups.  E.g.,

  > f <- function(a,b,c) c(a,b,c)
  > f(11,12,13)
  [1] 11 12 13
  Warning messages:
     looking for function "c", ignored local non-function in: f(11, 12,
13)

I don't have easy access to any older version of S+.  Somewhere along
the line we dropped the warning.

Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 



More information about the R-devel mailing list