Re: [R] accessing unexported functions

From: Seth Falcon <sfalcon_at_fhcrc.org>
Date: Mon, 21 May 2007 07:59:18 -0700

Erich Neuwirth <erich.neuwirth_at_univie.ac.at> writes:

> I need to access some internal function of a package temporarily.
> These functions normally that are not visible outside of the package.
> I know the MyPackage:::myfunction mechanism,
> but that does not solve my problem.
> Instead, I need to add the "internal namespace" of the package
> to the search path, then I can run a few commands with these functions
> available, and then the internal namespace should become
> invisible again.
>
> Is there a code example to achieve this?

Perhaps something like

pkgEnv = getNamespace("MyPackage")
attach(pkgEnv)

You might also be interested in assignInNamespace -- perhaps you can add you function to the package's name space and then call it using :::.

Be warned, this is the wrong way to solve a long-term problem. Bad things will happen and nobody will feel sorry for you.

+ seth

-- 
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
http://bioconductor.org

______________________________________________
R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 21 May 2007 - 15:03:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 May 2007 - 15:31:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.