Skip to content
Prev 326097 / 398503 Next

Data Package Query

On 28/06/13 04:47, Jeff Newmiller wrote:
<SNIP>
<SNIP>

This is simply not true.  I believe it *used* to be true, sometime 
waaaaayyyy back,
but hasn't been true for years.  The R language is much cleverer now.  
If there
is a function "melvin()" somewhere on the search path and also a data object
"melvin" (earlier on the search path) then doing

     melvin(<whatever>)

will correctly call the function melvin() with no complaints.  The R 
language
"can tell" by the parentheses that you mean the *function* melvin and 
not the
data object "melvin".

E.g.

     data <- 42
     require(akima)
     akima
     Error: object 'akima' not found
     data(akima)  # No error message, nor nothin'!
     akima
     # The data set "akima" is displayed.

All that being said it is ***BAD PRACTICE***, just in terms of 
comprehensibility
and avoiding confusion, to give a data set set the same name as a function
(either built in, or one of your own).

     fortune("dog")

is relevant.

     cheers,

         Rolf Turner