From jorismeys at gmail.com  Fri Feb 24 16:09:45 2012
From: jorismeys at gmail.com (Joris Meys)
Date: Fri, 24 Feb 2012 16:09:45 +0100
Subject: [Rd] function remains loaded in the search space after
 detaching the package
In-Reply-To: <alpine.LFD.2.02.1202241248160.8848@toucan.stats.ox.ac.uk>
References: <CAO1zAVbj-3ZS6zjPM9iR2+v_jZpccQNLqLsd4pm-jc7Yu6Jh2A@mail.gmail.com>
	<20295.29295.713484.449385@stat.math.ethz.ch>
	<4F477DAD.2050201@stats.ox.ac.uk>
	<CAO1zAVboAimGfvdT0whSd_eDYFpn7RdQK7K2msw9Q+-ycS58jg@mail.gmail.com>
	<alpine.LFD.2.02.1202241248160.8848@toucan.stats.ox.ac.uk>
Message-ID: <CAO1zAVYjhO7rn0HUukfBkvXdgLP_d+kLRMa09VAhsW7HLyhiwg@mail.gmail.com>

2012/2/24 Prof Brian Ripley <ripley at stats.ox.ac.uk>:
>
> As
>
> getS3method('print', 'object_size')
>
> would have confirmed the expectations of a 'one' with a less sketchy
> understanding of R.
>
Yes, getS3method() sends you -not very surprisingly- to the one from
gdata. I realized, as print(object.size(iris)) gets that one as well,
and even in my sketchy understanding of R I suspect that both actions
have a similar underlying mechanism. But that's not my point.

Why would I have to expect the gdata version is still used (under the
correct assumption that I haven't been writing on the R source code
myself)? As a maybe-not-so-smart basic user of R, I would expect that
detach() and eventually unloadNamespace() would revert the effect of
library() (and loadNamespace() ). Apparently they don't.

The only way to reverse the action of require(gdata) seems to be to
restart R. That's at least what my limited brain could understand from
the valuable information given by both you and Martin. Seemingly
having to restart an application to undo an action, even in the
presence of functions with names that make you believe they revert a
former action, might in general be conceived as rather unexpected by
somebody with the same sketchy understanding of R as me. I would be
delighted if you could explain to me which part of R I understand
wrongly to come to this silly observation.

Sincerely,
Joris



-- 
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Mathematical Modelling, Statistics and Bio-Informatics

tel : +32 9 264 59 87
Joris.Meys at Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php



[Rd] function remains loaded in the search space after detaching the package
Joris Meys