Skip to content
Prev 366957 / 398506 Next

Function that works within a package and not when copied in global environment. Why?

OK.

Try:  nlWaldTest:::vectorize.args  (3 colons)

Your error message said it was *not* exported, so you need 3 colons
(which, in general, is a bad idea.It's usually not exported for a
reason).

I presume vectorize.args is is in the environment of the function
copied from the name space, because functions are actually closures
that include (pointers to) their environments; whereas it is certainly
not part of the (global) environment, the environment of the manually
created function by copy-paste of the code.

If I am wrong about this, I would appreciate a correction by someone
with better understanding of such subtleties than I.

-- Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Thu, Feb 2, 2017 at 8:34 AM, Marc Girondot <marc_grt at yahoo.fr> wrote: