[R] Unwanted association between a function and a namespace

Patrick Connolly p_connolly at slingshot.co.nz
Thu Dec 24 02:14:00 CET 2009


Tnanks for the help, Duncan.

On Wed, 23-Dec-2009 at 06:57PM -0500, Duncan Murdoch wrote:

> On 23/12/2009 6:08 PM, p_connolly at slingshot.co.nz wrote:

[...]

>> I thought I'd found a fix when I specifically loaded plyr and then
>> detached it with the unload = TRUE argument.  sessionInfo() seems to
>> show that I had gotten rid of the plyr by namespace, but I still get this:
>>
>> summarize
>> function(.data, ...) {
>>   eval(substitute(data.frame(...)), .data, parent.frame())
>> }
>> <environment: namespace:plyr>
>>
>> Curiouser and curiouser as Alice would say.
>
>

> And where is that function?  find("summarize") should tell you.  The
> fact that it has the plyr namespace as its environment doesn't mean
> it is stored there.

Were one to believe what find("summarize") says, it's in the search
position where I put it.  However, what's in that position, ISN'T what
is returned when one types 'summarize' at the prompt.  Though, as I
indicated earlier, ESS gets the correct one if I wish to edit it.

The only way I found to get round the problem was to make an
additional function Summarize in the same place.  It involves editing
any old scripts/functions before they work, but work they do.

best

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.




More information about the R-help mailing list