From pdalgd at gmail.com  Fri Jun 28 20:22:38 2013
From: pdalgd at gmail.com (peter dalgaard)
Date: Fri, 28 Jun 2013 20:22:38 +0200
Subject: [Rd] problem with eval(...,
	parent.frame(1L)) when package is not loaded
In-Reply-To: <loom.20130628T183725-282@post.gmane.org>
References: <51CD07D9.7070201@ufl.edu> <51CD66B7.60303@gmail.com>
	<loom.20130628T183725-282@post.gmane.org>
Message-ID: <F7048526-5250-4CE3-B858-017A8455FD8C@gmail.com>


On Jun 28, 2013, at 18:42 , Ben Bolker wrote:

> Duncan Murdoch <murdoch.duncan <at> gmail.com> writes:
> 
>> 
> 
> [snip]
>> 
>> The other choice is to use the explicit ::, i.e.
>> 
>> mc[[1]] <- quote(lmer::lFormula)
>> 
>> This would be the solution I'd prefer, but you seem to have some 
>> prejudice against :: .
>> 
> 
>  I just thought that the whole point of using the machinery of
> namespaces, environments, etc., was that we shouldn't need to
> tell R explicitly what environment we were working in ...

Not really. The point is to avoid name clashes. In a sense, the fundamental mode of operation is to use qualified names, but there are convenience features that let you use them unqualified by attaching or importing (parts of) the namespace. But, if, as in the present case, you can't assume that the lmer namespace is imported/attached by the caller, you likely shouldn't force it to be so for an eval.parent()-type call. So the qualified name is a natural solution in that case. 

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] problem with eval(..., parent.frame(1L)) when package is not loaded
peter dalgaard