[Rd] Arguments of 'transform'

From: <Bill.Venables_at_csiro.au>
Date: Sat 11 Feb 2006 - 01:46:33 GMT


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@csiro.au
http://www.cmis.csiro.au/bill.venables/

R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Feb 11 12:48:23 2006

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:41 GMT