[Rd] Arguments of 'transform'

Bill.Venables@csiro.au Bill.Venables at csiro.au
Sat Feb 11 02:46:33 CET 2006


If you would like a 10 second R puzzle, you might like to think about
this one:


> g <- expand.grid(long = 130:140, lat = -(10:25))
> gp <- transform(g, x = long, y = lat)
Error in transform(g, x = long, y = lat) : 
        object "long" not found


I don't expect this hasn't come up before, but I can't find mention of
it.  I suggest that to minimise this little stumbling block for
beginners (and others) we either

	change the name of the principal argument in transform from 'x'
to, say '.x' (or even 'data' as it is in 'with' for example)  OR

	at least put a note in the help file for 'transform' in the
'Detalis' section to say
     
	*** NOTE: The only tag name unavailable to be used is 'x'. ***

Just another little seed.

Bill.

Bill Venables, 
CMIS, CSIRO Laboratories, 
PO Box 120, Cleveland, Qld. 4163 
AUSTRALIA 
Office Phone (email preferred): +61 7 3826 7251 
Fax (if absolutely necessary):    +61 7 3826 7304 
Mobile (rarely used):                +61 4 1963 4642 
Home Phone:                          +61 7 3286 7700 
mailto:Bill.Venables at csiro.au 
http://www.cmis.csiro.au/bill.venables/



More information about the R-devel mailing list